[mdlug] RSYNC Question

Carl T. Miller carl at carltm.com
Thu Sep 28 16:06:04 EDT 2017


JeremyBekka C wrote:
> I use rsync to keep my computer backed up with my external hard drive.
> This
> is the command that I use:
>
> rsync -rltDvu --modify-window=1 --progress --delete --delete-excluded
> --exclude-from=/home/username/Documents/Backup-Exclude-List.txt
> /home/username /run/media/username/Iomega\ HDD/Backup
>
>
> This command works fine for routine backups, but there is a problem when
> using it on a new install. For example, I just installed an new Linux OS
> on
> my desktop computer and ran this command in reverse to put all my stuff
> back on my computer from the external Iomega. Instead of putting
> everything
> where it belongs, it created a new folder called "Backup" in my /home
> directory and filled it with everything on the Iomega. I had to manually
> move everything back where I wanted it.

When you use "/home/username" as a source, it takes that
to mean the directory itself.  If you use "/home/username/"
for the source, it takes that to mean the contents of the
directory.  The trailing slash (or lack of one) makes a
difference for the source.  It doesn't matter whether or
not there's a trailing slash for the destination.

c




More information about the mdlug mailing list