Current time: 04-23-2014, 12:34 PM Hello There, Guest! (LoginRegister)

Post Reply 
cron job time-zone change
11-26-2011, 03:24 PM
Post: #1
cron job time-zone change
I've got a cron job running to fetch a jpeg at a static URL so I can build time-lapse videos. Everything is going fine except that the time/date stamp are all Pacific Time since that's where DreamHost is. I'd like to have the time stamp with the offset to Hawaii Standard Time (we never go into DST). We're -10 offset UTC if that's any help as it's probably better to base upon that rather than PST due to DST?

Here's an example of the code I currently have that gets the remote jpeg, changes the filename to embed custom name, date and time.

Code:
cd mydomain.com/time-lapse-image
wget -O staticimage-`date +%Y-%m-%d-%H%M%S`.jpeg
http://www.remotesite.com/cam/photo.jpg
Visit this user's website Find all posts by this user
Quote this message in a reply
11-26-2011, 04:42 PM
Post: #2
RE: cron job time-zone change
Try

Code:
export TZ='Pacific/Honolulu'
cd mydomain.com/time-lapse-image
wget -O staticimage-`date +%Y-%m-%d-%H%M%S`.jpeg
http://www.remotesite.com/cam/photo.jpg

Customer since 2000 Cool openvein.org | Please don't feed the trolls. Angry
Visit this user's website Find all posts by this user
Quote this message in a reply
11-26-2011, 06:09 PM
Post: #3
RE: cron job time-zone change
Excellent! That seems to have done the trick. Mahalo
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: