brent timothy saner via plug on 24 Jul 2019 08:24:18 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] backup help needed


On 7/24/19 11:02 AM, Rev. LeRoy D. Cressy via plug wrote:
> when using the -a you should be as root or using sudo.
> 
> I like using rsync since only the updated and latest files will be backed up.
> 
> The external drive should be mounted for this to work.  Also the external drive should be partitioned and formatted with a Linux / BSD file system like ext4, zfs, or whatever you prefer.
> 
> sudo rsync -av /home/ /mnt/external/
> 
> 
> Rev. LeRoy D. Cressy
> 


well, yes and no.

-a (for both cp and rsync) for a home dir only requires root/sudo if the
source has a "." or ".." that's root-owned, because it copies
permissions. but that wouldn't be why he's missing dotfiles if he copied
the homedir itself or ".". He would very absolutely get permission
errors if that were why.

FWIW, /home/<user>/ has a .. item (/home) that IS root-owned.

this is easily circumvented, though.

mkdir /mnt/external/<user>
rsync -a /home/<user>/. /mnt/external/<user>/.

but +1 to others suggesting rsync. it does a little better job of
retaining file attributes.

but, since this is a backup, if you have any files that are symlinks
that point outside your homedir, i'd recommend using -aL for rsync,
which should copy the content of symlink destinations instead of
symlinks as symlinks (-a implies -l).

BUT even MORE importantly, i'd recommend a proper backup software like
borg[0] (my personal recommendation) or restic[1].


[0] https://borgbackup.readthedocs.io/en/stable/
[1] https://restic.net/

Attachment: signature.asc
Description: OpenPGP digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug