On Fri, Sep 13, 2024 at 10:54 AM Michael via PLUG-discuss <
plug-discuss@lists.phxlinux.org> wrote:
> chatgpt is telling me to rsync with...
>
> sudo rsync -aAXv --delete
> --exclude={"/home/bmike1/.cache","/home/bmike1/.local/share/Trash"} /home/
> /media/$USER/rsync/
>
> and to restore with:
>
> sudo rsync -aAXv --delete
> --exclude={"/home/bmike1/.cache","/home/bmike1/.local/share/Trash"}
> /media/$USER/rsync/ /home/
>
> the save stage ran correctly but will the restore run correctly?
>
It should but in your command composition, rsync will pick up other
directories under /home/.
Although on the restore command these options (--delete
--exclude={"/home/bmike1/.cache","/home/bmike1/.local/share/Trash"} ) do not
make sense to me. A
Also, why do you need 'sudo'?
For my backups, I run the rsync commands directly from the user's home
directory e.g. /home/bmike1/
FWIW please read the man page for -a and -A/-X nuances + logging the backup
to record what went right/wrong.
(Note the changes in bold. Also, -a will not work for backup media (USB
drives) formatted with Microsoft files systems (vfat, exFAT, NTFS)
Backup:
cd $HOME
rsync -*aP* *--log-file=FILE* --delete --exclude={"$HOME/.
cache","$HOME/.local/share/Trash"} $HOME/ /media/$USER/rsync/
Restore:
cd $HOME
rsync -*aP* *--log-file=FILE* /media/$USER/rsync/ $HOME/
Create a user e.g. testuser, create some files under the home directory,
and do a test drive and verify the results of the backup and restore.
HTH
--
--
Arun Khan
---------------------------------------------------
PLUG-discuss mailing list:
PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss