Sync files-from with delete

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Sync files-from with delete

john espiro
I have a local directory that I am trying to sync with a remote directory.  That's fine, but there's a lot of data that is out of sync so I decided to make a local copy of the difference to then bring to the remote location.


So I ran a dry-run between the two to generate a list of files in listOfFiles.txt

Then I ran rsync from local to localBackup.


rsync -av --files-from=/tmp/listOfFiles.txt /var/MyData/ /USB/Backup/


Now, while this is happening, I am still rsycning between my local and my remote.  So I re-generate the listOfFiles.txt, which contains less things to copy than before.... I'd like to delete anything in /USB/Backup that is not in the listOfFiles.txt

TLDR: I want to make a local backup of the differences between local and remote and sync them to a separate local drive.

Thanks...
--
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
Reply | Threaded
Open this post in threaded view
|

Re: Sync files-from with delete

Simon Hobson-2
john espiro <[hidden email]> wrote:

> I have a local directory that I am trying to sync with a remote directory.  That's fine, but there's a lot of data that is out of sync so I decided to make a local copy of the difference to then bring to the remote location.
>
>
> So I ran a dry-run between the two to generate a list of files in listOfFiles.txt
>
> Then I ran rsync from local to localBackup.
>
>
> rsync -av --files-from=/tmp/listOfFiles.txt /var/MyData/ /USB/Backup/
>
>
> Now, while this is happening, I am still rsycning between my local and my remote.  So I re-generate the listOfFiles.txt, which contains less things to copy than before.... I'd like to delete anything in /USB/Backup that is not in the listOfFiles.txt

Does it matter ? Take your USB drive to the remote location, rsync the files - any that are the same will be skipped. Then you can resume resyncing remotely as normal.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Sync files-from with delete

john espiro




----- Original Message -----
From: Simon Hobson <[hidden email]>
To: "[hidden email]" <[hidden email]>
Cc:
Sent: Friday, June 26, 2015 8:07 AM
Subject: Re: Sync files-from with delete

john espiro <[hidden email]> wrote:


> I have a local directory that I am trying to sync with a remote directory.  That's fine, but there's a lot of data that is out of sync so I decided to make a local copy of the difference to then bring to the remote location.
>
>
> So I ran a dry-run between the two to generate a list of files in listOfFiles.txt
>
> Then I ran rsync from local to localBackup.
>
>
> rsync -av --files-from=/tmp/listOfFiles.txt /var/MyData/ /USB/Backup/
>
>
> Now, while this is happening, I am still rsycning between my local and my remote.  So I re-generate the listOfFiles.txt, which contains less things to copy than before.... I'd like to delete anything in /USB/Backup that is not in the listOfFiles.txt

Does it matter ? Take your USB drive to the remote location, rsync the files - any that are the same will be skipped. Then you can resume resyncing remotely as normal.




The remote location is rather remote, so that wouldn't work in this particular case.
--
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
Reply | Threaded
Open this post in threaded view
|

Re: Sync files-from with delete

Simon Hobson-2
john espiro <[hidden email]> wrote:

> The remote location is rather remote, so that wouldn't work in this particular case.

I don't follow, weren't you planning to take the USB device to the remote location to copy some of the files ? If you are doing that, then it doesn't really matter if you have extra files on the disk.

Otherwise, I think you need to explain better what it is you are trying to do.

--
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