Timestamp to upload folder

Requests for future functionality

Moderator: Mattk

Post Reply
neppers
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: Mon Aug 15, 2011 6:38 pm

Timestamp to upload folder

Post 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?
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Timestamp to upload folder

Post by admin »

sorry, only file name can be controlled by patterns.
neppers
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: Mon Aug 15, 2011 6:38 pm

Re: Timestamp to upload folder

Post by neppers »

Maybe someone know how to make a cron script to do this? :-)
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Timestamp to upload folder

Post 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 :!:
neppers
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: Mon Aug 15, 2011 6:38 pm

Re: Timestamp to upload folder

Post 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.
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Timestamp to upload folder

Post 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`
Post Reply