How to remotely get pictures


Forum: Networking
Topic: How to remotely get pictures
started by: danielp

Posted by danielp on Oct. 31 2007,14:20
Hi all,

This is not DSL specific, but since I'm a Linux newbie, I'd like to learn how to do this. I would like to:
-connect to a website or FTP site every day (cron?) and see if there are new pictures in a specific directory. If yes, then I download them to the DSL box and delete them remotely.

I can use either a webspace or an FTP space; whatever is more convenient.

Which programs/scripts should I use for this task? Thanks for your help!

Posted by ^thehatsrule^ on Oct. 31 2007,15:02
You can use cron, and ftp.

- save your ftp commands in a file.  The logic in this depends on how you set up your new pictures directory.  It'd be much easier if you just have a dedicated directory for that, so you can easily download all, then delete all (i.e. with globbing, use mget and mdelete)
- create a shell script to uses them (i.e. with `ftp < myftpcommands` )
- add an entry to cron that runs your shell script at whichever times

note: If you think its not specific to DSL, why the post in a DSL specific section? :P

Posted by danielp on Oct. 31 2007,16:03
I posted here because I will be using DSL for the Digital Picture Frame. I think it's not DSL specific because I guess it is common to all linux scripting, no? Should I ask on another forum?

If I understand you well, it's possible to write a script that will "simulate" typing ftp commands. Could you give me an example? Like how to login in first, list remote dir and see if there are any files there? Thanks!

Posted by curaga on Oct. 31 2007,16:37
I'll try.

The command "ftp < mycommands" will take all input from the file "mycommands". So here's a sample of what to put into that:
Quote
user
password24456
ls

Posted by newOldUser on Oct. 31 2007,16:48
I have found this article to be of use in the past:

< http://w3.linux-magazine.com/issue/59/Automating_FTP.pdf >

Posted by ^thehatsrule^ on Oct. 31 2007,18:04
Well, I'll just point out there's a non-DSL section (with a subcategory for scripting too).  It probably doesn't matter at this point.

You can see how to use a program usually with `man <program>` and you can usually append --help or -help, or in the program itself, help.  Using a web search on "linux man <program>" will also work.

btw, that's nice looking pdf.

Posted by danielp on Nov. 01 2007,11:33
Yes, that article is of great help, thanks for the link!
Posted by skaos on Nov. 05 2007,14:15
You could take a look at wget: < http://www.gnu.org/software/wget/ >
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.