From a DD-WRT router I want to create a cron-job that wget's an image from a remote location. This image is to be passed on to a remote FTP server for storage. The process is to be repeated every minute, naming the destination image on the ftp with the current time :

wget: get file from -> http://37.***.9.95/fullsize.jpg 

ftp: put fullsize.jpg -> ftp://83.***.151.224/shares/camera/dateTimeNow.jpg

Where dateTimeNow is the current time. The ftp server for storage is not smart enough to have either cron nor something else than just FTP. the DD-WRT device however, has cron!

  • Do you want dateTimeNow.jpg to be that string or the actual date/time now? – slm May 3 '13 at 15:11
  • Also can you confirm that dd-wrt provides cron facilities? – slm May 3 '13 at 15:12
  • 2
    Can't you do this directly from the ftp server? – terdon May 3 '13 at 15:21
  • dd-wrt has cron: dd-wrt.com/wiki/index.php/CRON – derobert May 3 '13 at 17:37
  • Do you have an FTP client available on your dd-wrt? Unless you have optware enabled and have installed one, I'd guess "no". – derobert May 3 '13 at 17:39

If curl is available, something like this should work (untested; choose your own timestamp format for date command):

curl http://source/image.jpg | curl --upload-file - "ftp://destination/$(date +%F).jpg"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.