[PLUG] Rsync again

Roderick Anderson raanders42 at gmail.com
Sat Oct 6 23:42:22 UTC 2018



On 10/06/2018 02:50 PM, John Jason Jordan wrote:
> On Sat, 6 Oct 2018 12:23:04 -0700
> Erik Lane <eriklane at gmail.com> dijo:
> 
>> That would be nice to be able to stop it in that way. I'm not a Linux
>> guru, so I'd also like to hear if there's some way to do that.
>>
>> However, I just wanted to say that I always use -P as one of the
>> options, and this will resume partial downloads. So if you have to
>> stop it and then resume later, it will just pick up where it left off.
>>
>> Not quite what you were asking for, but another way to solve the same
>> problem. (At least as far as I understood your question.)
> 
> Well, the problem resolved itself, at least in this case. The reason I
> wanted to stop it was because I was watching and it was backing up
> files that I was pretty sure had already been backed up, and the only
> reason it might be doing that was if the backup device was not mounted.
> As it turns out my guess was right, 15 minutes later rsync stopped
> all by itself when it ran out of space on the mount point drive.
> 
> And this is not the first time I have copied things to a drive that I
> thought was mounted, but was not. It's a perennial problem, and it's
> high time I figured out a way to keep it from happening.

If you are using/allowing the system to automagically mount your  device 
you should test if it is there before starting the backup.

I used this method years ago to back up my club accounting data.

OOPS ... wrong! I was pushing the files to my ownCloud server so I used 
ping to test for it's existence.

Here is the script (obfuscated to protect the guilty.)  You could figure 
out your own test.

#!/bin/bash

/bin/ping -c 1 cloud.host.net 2> /dev/null | grep " 0% packet loss" > 
/dev/null

if [[ $? == 0 ]]; then
    echo cloud found
    rsync -n -avz --update /home/user/Data/FILE /user/ownCloud/CLUB/DATA
else
    echo cloud not found
fi


\\||/
Rod
-- 

> _______________________________________________
> PLUG mailing list
> PLUG at pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
> 



More information about the PLUG mailing list