Register
It is currently Sat Sep 20, 2014 9:59 am

File With Time In


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Fri Apr 09, 2010 3:19 pm   

Joined: Fri May 16, 2008 4:58 am
Posts: 94
I'm doing a script where my webcam takes a pic and stamps it file %d%m%Y_%H%M%S after that an ftp command runs to upload it however as i've used 'date' in this the picture is taken 1 second before ftp looks for it and hence can't find it.

Rather than do -1 second as it's possible that it could take longer etc what other way can I achieve this?

thanks


Top
 Profile  
 PostPosted: Fri Apr 09, 2010 5:37 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 547
keep timestamp in a variable :-/
you could use it in your ftp commands


Top
 Profile  
 PostPosted: Sat Apr 10, 2010 4:35 am   

Joined: Fri May 16, 2008 4:58 am
Posts: 94
I've had a go but with no success as i'm not sure how to save the time outputed by the capture software

it uses the following in the conf file

archive = /home/grabs/camera_%d-%m-%Y_%H-%M-%S.jpeg


Top
 Profile  
 PostPosted: Sat Apr 10, 2010 7:40 am   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 547
Code:
archive="/home/grabs/camera_$(date +'%d-%m-%Y_%H-%M-%S').jpeg"
time_ext="${archive#*_}"
timestamp="${time_ext%%.*}"
ext="${time_ext#*.}"
pathNname="${fileName%%_*}"
echo "${pathNname}_${timestamp}.${ext}"
/home/grabs/camera_10042010_153024.jpeg


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP