Hi I'd like to rsync a large amount of data over a slow connection, but only during night hours. I couldn't find a parameter that limits the time that rsync is running, only the timeout on idle time. I guess the way to go would be to start rsync, get the process ID and kill the process later on. Has anybody already written a bash script that would do something like that? Are there other ways? I don't want to kill all rsync processes as there might be other syncs going on. Thanks bye Fabi
Hi, I have done this with a cron job, only the first time i had to transfer 15GB, but did it first time in the weekend, afterwards, in my situation is only a small amount of data that has to be transfered every night, so every day at 02.00 the rsync starts and stops automaticly within 1-3 hours. Best Regards Tomas 2009/9/17 Fabian Cenedese <Cenedese at indel.ch>:> Hi > > I'd like to rsync a large amount of data over a slow connection, > but only during night hours. I couldn't find a parameter that limits > the time that rsync is running, only the timeout on idle time. > I guess the way to go would be to start rsync, get the process > ID and kill the process later on. > > Has anybody already written a bash script that would do something > like that? Are there other ways? I don't want to kill all rsync > processes as there might be other syncs going on. > > Thanks > > bye ?Fabi > > -- > Please use reply-all for most replies to avoid omitting the mailing list. > To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html >
On Thu 17 Sep 2009, Fabian Cenedese wrote:> > Has anybody already written a bash script that would do something > like that? Are there other ways? I don't want to kill all rsync > processes as there might be other syncs going on.There is for example a "timeout" package available in Debian: Package: timeout Description: run a command with a time limit timeout executes a command and imposes an elapsed time limit. When the time limit is reached, timeout sends a predefined signal to the target process. Homepage: http://www.porcupine.org/forensics/tct.html So use that: $ timeout 7200 rsync .... That will kill rsync after 2 hours (7200 seconds). Paul
At 15:14 17.09.2009 +0200, Paul Slootman wrote:>On Thu 17 Sep 2009, Fabian Cenedese wrote: >> >> Has anybody already written a bash script that would do something >> like that? Are there other ways? I don't want to kill all rsync >> processes as there might be other syncs going on. > >There is for example a "timeout" package available in Debian: > >Package: timeout >Description: run a command with a time limit > timeout executes a command and imposes an elapsed time limit. When the time > limit is reached, timeout sends a predefined signal to the target process. >Homepage: http://www.porcupine.org/forensics/tct.htmlThat would be what I need. But I have rsync running on a NAS with BusyBox, so I'd need to cross-compile it. That's why I was looking for a bash script. If other people have the same need: I found a script on the net: http://twoday.tuwien.ac.at/jo/stories/320762/ Thanks bye Fabi
Rsync has a 'time-limit' patch with following options: --stop-at=y-m-dTh:m Stop rsync at year-month-dayThour:minute --time-limit=MINS Stop rsync after MINS minutes have elapsed Tev> Hi > > I'd like to rsync a large amount of data over a slow connection, > but only during night hours. I couldn't find a parameter that limits > the time that rsync is running, only the timeout on idle time. > I guess the way to go would be to start rsync, get the process > ID and kill the process later on. > > Has anybody already written a bash script that would do something > like that? Are there other ways? I don't want to kill all rsync > processes as there might be other syncs going on. > > Thanks > > bye Fabi > > -- > Please use reply-all for most replies to avoid omitting the mailing list. > To unsubscribe or change options: > https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html >