On Fri, 2003-07-18 at 08:43, Reuben D. Budiardja wrote:

> On Thursday 17 July 2003 07:52 pm, Bret Hughes wrote:
> > How bout simply running rsync against the whole shebang but having
> > another cron job kill rysnc at the end of your time window? The next
> 
> OK, those seems to be a more viable solution. Just kill the rsync after an 
> hour, regardless how much data get transported. 
> 
> Will 'killall rsync' do it? Since of course I don't want to get up at 3 AM in 
> the morning to kill rsync. If not, then a script needs to be written to get 
> the pid and kill it, which I am not on how to do it just yet.

Yeah probably but not too clean as it would kill anything else rsync
might be doing.  How about wrapping the rsync call in a wrapper script
and writting the pid of the wrapper to a file:


[EMAIL PROTECTED] Workingdir]$ cat ~/bin/testrsync 
#!/bin/bash
outfile="/tmp/rsync.out"
echo $$ > "/tmp/rsyncjob.pid"
echo "beginning rysnc.job at " `date` > "$outfile"
rsync -arvvze /usr/bin/ssh /home/bhughes/mydata compaq3:.  >>"$outfile"
2>&1

then you can have the kill job do something like :

kill `cat /tmp/rsyncjob.pid`   

Those are backtics

HTH

Bret
> 
> Thanks for all who replied. but certainly if anyone else think of something 
> cool would be greatly appreciated.
> 
> RDB
> -- 
> Reuben D. Budiardja
> 
> 
> -- 
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]
> https://www.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to