Page 1 of 1

Timestamp to upload folder

Posted: Wed Aug 31, 2011 9:59 am
by neppers
I see there is a function for filenames to get named by a timestamp f.ex %F_%R.png, so that filenames became 2007-09-23_15:10.png. Is it possible to include that also a corresponding folder is created at upload? So that the file 2007-09-23_15:10.png will be uploaded to a folder structure like /2007/09/23/15:10.png?

Re: Timestamp to upload folder

Posted: Wed Aug 31, 2011 10:59 pm
by admin
sorry, only file name can be controlled by patterns.

Re: Timestamp to upload folder

Posted: Thu Sep 01, 2011 11:35 am
by neppers
Maybe someone know how to make a cron script to do this? :-)

Re: Timestamp to upload folder

Posted: Thu Sep 01, 2011 6:48 pm
by wfpost
sure, shouldn´t be a problem. FTP upload or internal folder on meteohubs filesystem?
From where is that png file coming? A graph created with meteohub. Or from a webcam source?

: is an illicit character anyway :!:

Re: Timestamp to upload folder

Posted: Thu Sep 01, 2011 7:00 pm
by neppers
Thanks for the interrest in this :-) Ftp-upload. The graph should be generated by meteohub with timestamp in filename. F. example a graph for every month for temperature should be temp<year><month>.png. Or for every week temp<year><weeknumber>.png.

Re: Timestamp to upload folder

Posted: Thu Sep 01, 2011 9:06 pm
by wfpost
okay, creating the date structure is not difficult with the mighty linux command DATE - used within a shell script.
the other thing is "how to create a png graph from a shell script?" :roll: :roll:

Maybe Boris can jump in and give us the shell script command for creating a png graph file, then I can give you the code to create a date based directory structure for your graphs.

Thanks,

just to give a glimpse how the ftp upload is working with a shell script
ncftpput ist clever enough to create the folder if not already existing. NICE!
e.g.

this command is uploading my webcam shots to an external ftp server >>>

Code: Select all

/usr/bin/ncftpput -u user -p password honsol_753087.ho.funpic.de /`date -d 'today' +%Y_%m_%d` /data/myweb/`date -d 'today' +%Y-%m-%d_%H-%M_webcam.jpg`