tag:blogger.com,1999:blog-6697950304516138442.post1232556665491766265..comments2022-03-02T09:11:36.714-06:00Comments on Ian!: Rsync and retrying until we get it rightIanhttp://www.blogger.com/profile/14922548722060582232noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-6697950304516138442.post-61216924110884942542020-09-09T21:13:56.847-05:002020-09-09T21:13:56.847-05:00Thanks! Still relevant today.Thanks! Still relevant today.JamesHhttps://www.blogger.com/profile/00778245599527091325noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-74600498836362418832017-07-13T09:51:40.012-05:002017-07-13T09:51:40.012-05:00This script is pure gold, had to transfer one larg...This script is pure gold, had to transfer one large file from Madagascar with a very unreliable network connection. This script worked like a charm, thankyou.Matthttps://www.blogger.com/profile/10093618679352139765noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-71677621397085790752014-10-18T00:18:21.294-05:002014-10-18T00:18:21.294-05:00Ian, thanks for this.
Question - after a successfu...Ian, thanks for this.<br />Question - after a successful transfer, the command doesn't work anymore until I restart my whole machine. I guess because the sucessful code is stored in memory.<br /><br />I'm new to Unix, how do I reset it so I can issue the command again?<br /><br />Thanks!David Mackenziehttps://www.blogger.com/profile/11415521113299930033noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-33803276672964989222014-06-09T11:34:27.591-05:002014-06-09T11:34:27.591-05:00somebody should tell rsync they need a "try f...somebody should tell rsync they need a "try forever" command line option...Roger Packhttps://www.blogger.com/profile/01578246846716577925noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-36304479008721301762012-10-18T18:00:58.759-05:002012-10-18T18:00:58.759-05:00@andymat Sure! You can change the rsync line from ...@andymat Sure! You can change the rsync line from `rsync -avz ...` to `rsync -avz ... || sleep 30s`.Ianhttps://www.blogger.com/profile/14922548722060582232noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-23479515274774350702012-10-17T15:49:44.669-05:002012-10-17T15:49:44.669-05:00Is it possible to add a wait of 30 or 60 seconds b...Is it possible to add a wait of 30 or 60 seconds between connection attempts?andymathttps://www.blogger.com/profile/01484350667667364212noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-23600915049518333462012-06-14T11:37:08.147-05:002012-06-14T11:37:08.147-05:00So the problem with the above approach is that if ...So the problem with the above approach is that if you are paranoid like myself and use "bash -e" basically everywhere, setting the initial return value to "false" will cause your script to exit.<br /><br />Instead I used your script as inspiration and did it this way instead:<br /><br />trap "exit;" INT TERM EXIT<br /><br />retries=7<br /><br />i=0<br /><br />while ! rsync SOURCE USER@HOST:/PATH && \<br />[ $i -le $retries ]<br />do<br /><br /> echo "rsync failed! Retrying..."<br /> let i=$i+1<br /><br />done<br /><br />trap - INT TERM EXIT<br /><br /><br />...mind you I haven't implemented it yet but it seemed to work when I replaced the rsync command with "false." ;-)Anonymoushttps://www.blogger.com/profile/15245688985502691296noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-14981038609614001372012-02-16T11:41:33.457-06:002012-02-16T11:41:33.457-06:00Your post was really usefull for me!
I´ll show you...Your post was really usefull for me!<br />I´ll show your script in my blog.<br />I hope you agree, if not please send me a message.<br /><br />Thanks a lot!<br />(my blog: http://blog blog.aguinar.com)aguinarhttps://www.blogger.com/profile/18114389692551586015noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-90258108404827905832012-02-15T06:50:09.580-06:002012-02-15T06:50:09.580-06:00thanks ;-))thanks ;-))735984https://www.blogger.com/profile/15199139703619110799noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-36494375692238428822011-03-19T07:42:48.566-05:002011-03-19T07:42:48.566-05:00Very neat... I am at =the stage you were, meaning ...Very neat... I am at =the stage you were, meaning my rsync script looks very much like your first shot and is not really dealing well with error and retries.<br />You deserve a kudoPhilippehttps://www.blogger.com/profile/03096896355265800663noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-7648623658191847102010-06-08T05:02:39.170-05:002010-06-08T05:02:39.170-05:00thank you! you rulethank you! you ruleRobhttps://www.blogger.com/profile/04085534964187517113noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-62494659569623098392010-04-14T16:58:59.416-05:002010-04-14T16:58:59.416-05:00I've extended your script so that you don'...I've extended your script so that you don't need to edit each time + a few extras... and created a fork on gist.git hub.<br />See here... <br /><br /><a href="http://gist.github.com/366269" rel="nofollow">http://gist.github.com/366269</a><br /><br />Hope you find it usefull!!Jason Martinhttps://www.blogger.com/profile/10339404121223089959noreply@blogger.comtag:blogger.com,1999:blog-6697950304516138442.post-12792920006056450182009-06-23T06:05:51.166-05:002009-06-23T06:05:51.166-05:00Thank you! Your post did save me from spending an...Thank you! Your post did save me from spending another day reading man pages. This does just what I was trying to do.Unknownhttps://www.blogger.com/profile/08762499226306842277noreply@blogger.com