[lug] rsync option --delete

Steve Sullivan steve.sullivan at mathcom.com
Mon Sep 1 16:01:01 MDT 2014

Have you tried:

cd /
rsync -avczr -e ssh --delete boot root at my_host:/embedded

I'm guessing in your tests the extra files in
my_host:/embedded/boot aren't mentioned in the source,
so rsync ignores them.


On Mon, Sep 01, 2014 at 09:20:49PM +0000, stimits at comcast.net wrote:
> Hi,
> I have an embedded system I'm backing up to a loopback mounted file system on a remote host (they're sitting next to each other with gigabit directly between them)...the loopback image was originally what was used to create the file system on the embedded system as an exact copy. Although the loopback used to be an exact byte-for-byte replica with the actual file system on the embedded system, the two have diverged due to package updates. The loopback mounted system is used for both backup and for cross-compiling.
> So...to keep the loopback on the host sync'd with the embedded system, rsync has been used. Mostly it is working right, but something is causing the loopback destination of rsync to not delete some of the files which no longer exist on the embedded source file system. So with the limited size of the loopback, I'm finding this failure to delete what shouldn't still remain to be something like a memory leak, consuming space which is valuable. I run as root on the embedded system, and connect as root on the host (permissions are not an issue), with this command:
> cd /boot
> rsync -avczr -e ssh --delete-before * root at my_host:/embedded/boot
> (boot is a small directory with easily confirmed file listings, so I chose this as a test)
> I've tried --delete, and --delete-before. I have older kernels removed on the embedded source's /boot, and newer kernels added. It fails to remove all files on destination which no longer exist. What am I missing, or what do I need to do so extraneous files are deleted and do not take up space?
> Thanks!

> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety


Steve Sullivan      steve.sullivan at mathcom.com
720-587-7498        http://www.mathcom.com

More information about the LUG mailing list