Problem with script that moves files under a day into another folder.
I'm in the making of a Video surveillance system and the program I am using makes each video into a couple of seconds long. Now I'm in the making of a script that will compile them all together but am having some trouble with the "find" command. I want it to move only files under a day, as in all the files created that day into a folder, which will then be compiled. Problem is when I run the script it copies EVERYTHING into the folder and not just things created in the last 12 hours or so. Heres what I have so far.
cd "/home/administrator/Desktop/Feed/cam1" mkdir temp find "/home/administrator/Desktop/Feed/cam1" -ctime -.05 -exec mv *.avi /temp {} \; cd temp mencoder *.avi -noidx -o temp.avi -ovc copy cp temp.avi "/home/administrator/Desktop/Feed/cam1" rm *.avi cd "/home/administrator/Desktop/Feed/cam1" rm -r temp mv temp.avi `date '+%m-%d-%y'`.avi I'm guessing it's something with the "find "/home/administrator/Desktop/Feed/cam1" -ctime -.05 -exec mv *.avi /temp {} \;" part. If im doing it all wrong then heres what I would like: At about 10-11PM I want it to take all the videos and compile them into one for the day then name it based on what day it is.So when I go to look what happened on EX: November 18th I can go into the /cam1 directory and see a movie name 11-18-2009. At the moment I have about 50 videos per day. Im using Ubuntu 9.04. I've been working at this for a few hours now but I'm not really going anywhere. Any ideas? -Thanks Nate |
I think
Code:
find . -name "*.avi" -ctime -1 -exec mv {} ./temp \; . stands for the current directory. Read carefully the find manual. Quote:
Code:
find . -name "*.avi" -ctime -1 -exec ls -l {} \; Greetings. |
...
|
All times are GMT -5. The time now is 05:41 AM. |