From: john b. <jo...@jo...> - 2009-11-15 23:23:28
|
i do this similarly. but, it's sometimes hard to get the date for yesterday right. so, i cron a master script just before midnight that gets the date, and feeds it to another script which it runs as an at job for something like midnight 30 or so. just another approach. On Thu, 2009-11-12 at 06:22 +0100, Milan van de Swaluw wrote: > Sam, > > it's probably best to change the script so that it does the actions for > 'yesterday' and start it at least a few minutes after midnight. > That way you make sure your events that you want to zip/delete/etc are > in a frozen state. > > And why not use an error-log ? e.g. call "script > error.log" from > crontab. That way you can see what happened... > > Milan. > > I > > ma...@ma... schreef: > > haha!! > > i'll have to agree, i havent seen anyone post "first!" or "gay!" on > > here... these kids nowadays. > > > > so i have a few q's of my own. > > i got everything set up, and it does an excellent job at the capture > > side of things. > > > > i became creative and tried to put together a script(added to crontab @ > > 12:00 midnight) that: > > 1. deletes JPEG's from today. > > 2. zips all the MPEG's into a file that is "dated" for today. > > 3. moves the .zip into another folder higher in the branch. > > 4. deletes the MPEG's from today.(essentially an elaborate archival) > > > > the problem that i am running into though, it works fine for the first > > day or so. > > thereafter, it doesnt go about naming the zip file correctly. > > im not sure as to whether or not it is the .sh file not built properly, > > that motion is running in the background(and might be trying to > > delete/move something while the script is running) or whether i have the > > calls to the $date or zip wrong. > > the script is as follows: > > > > ------begin code----- > > #!/bin/bash > > TODAY = $(date +%Y-%m-%d) > > rm /home/user/video/*.jpg > > zip /home/user/video/$TODAY.zip /home/user/video/*.avi > > cp /home/user/video/*.zip /home/user/video/older > > rm /home/user/video/*.zip > > rm /home/user/video/*.avi > > exit > > -----end code-------- > > > > if it is the fact that motion is running in the background, are there > > commands that i could crontab to shutdown the daemon, let it run, then > > start it again? > > any thoughts would be helpful and appreciated, but it isnt an immediate > > problem, as they have the dates already in the files, just more of an > > annoyance. > > thanx in advance. > > > > .-+M+-. > > Sam Mertz > > www.masam.net > > > > > >> -------- Original Message -------- > >> Subject: Re: [Motion-user] Invitation to connect on LinkedIn > >> From: Kenneth Lavrsen <ke...@la...> > >> Date: Wed, November 11, 2009 5:48 pm > >> To: mot...@li... > >> > >> > >> Dougie Nisbet wrote: > >> > >>> Dougie Nisbet wrote: > >>> > >>> > >>> oops, sorry. that's embarrassing. I don't think I've quite got the hang > >>> of this. please ignore, etc. > >>> > >>> > >>> > >> Don't worry > >> > >> After all, this is the friendliest mailing list on the internet ;-) > >> > >> Kenneth > >> > >> ------------------------------------------------------------------------------ > >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > >> trial. Simplify your report design, integration and deployment - and focus on > >> what you do best, core application coding. Discover what's new with > >> Crystal Reports now. http://p.sf.net/sfu/bobj-july > >> _______________________________________________ > >> Motion-user mailing list > >> Mot...@li... > >> https://lists.sourceforge.net/lists/listinfo/motion-user > >> http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome > >> > > > > > > ------------------------------------------------------------------------------ > > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > > trial. Simplify your report design, integration and deployment - and focus on > > what you do best, core application coding. Discover what's new with > > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > _______________________________________________ > > Motion-user mailing list > > Mot...@li... > > https://lists.sourceforge.net/lists/listinfo/motion-user > > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Motion-user mailing list > Mot...@li... > https://lists.sourceforge.net/lists/listinfo/motion-user > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome -- cleverly disguised as a responsible adult. |