<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:monospace"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 13, 2024 at 10:54 AM Michael via PLUG-discuss <<a href="mailto:plug-discuss@lists.phxlinux.org">plug-discuss@lists.phxlinux.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>chatgpt is telling me to rsync with...</div><div><div><div><div><div><div><div dir="auto"><div><div><div><br></div><div><span class="gmail_default" style="font-family:monospace"></span>sudo rsync -aAXv --delete --exclude={"/home/bmike1/.cache","/home/bmike1/.local/share/Trash"} /home/ /media/$USER/rsync/<br></div><div><br></div><div>and to restore with:</div><div><br></div><div>sudo rsync -aAXv <span class="gmail_default" style="font-family:monospace"></span>--delete --exclude={"/home/bmike1/.cache","/home/bmike1/.local/share/Trash"} /media/$USER/rsync/ /home/<br></div><div><br></div><div>the save stage ran correctly but will the restore run correctly?</div></div></div></div></div></div></div></div></div></div></div></blockquote><div><div class="gmail_default" style="font-family:monospace"></div><div class="gmail_default" style="font-family:monospace">It should but in your command composition, rsync will pick up other directories under /home/.  </div><div class="gmail_default" style="font-family:monospace">Although on the restore command these options (<span style="font-family:Arial,Helvetica,sans-serif">--delete --exclude={"/home/bmike1/.</span><span style="font-family:Arial,Helvetica,sans-serif">cache","/home/bmike1/.local/</span><span style="font-family:Arial,Helvetica,sans-serif">share/Trash"}</span><span style="font-family:Arial,Helvetica,sans-serif"> ) do</span> not make sense to me.  A</div><div class="gmail_default" style="font-family:monospace">Also, why do you need 'sudo'? </div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">For my backups, I run the rsync commands directly from the user's home directory e.g. /home/bmike1/ </div><div class="gmail_default" style="font-family:monospace">FWIW please read the man page for -a and -A/-X nuances + logging the backup to record what went right/wrong.</div><div class="gmail_default" style="font-family:monospace">(Note the changes in bold. Also, -a will not work for backup media (USB drives) formatted with Microsoft files systems (vfat, exFAT, NTFS)<br></div><div class="gmail_default" style="font-family:monospace"><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif">Backup:</span></div></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif">cd $HOME</span></div></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif">rsync -<b>aP</b> </span><span style="font-family:Arial,Helvetica,sans-serif"><b>--log-file=FILE</b> </span><span style="font-family:Arial,Helvetica,sans-serif">--delete --exclude={"$HOME/.</span><span style="font-family:Arial,Helvetica,sans-serif">cache","$HOME/.local/</span><span style="font-family:Arial,Helvetica,sans-serif">share/Trash"} $HOME/ /media/$USER/rsync/</span></div></div><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif">Restore:</span></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif">cd $HOME</span></div><div class="gmail_default" style="font-family:monospace"><div style="font-family:Arial,Helvetica,sans-serif"><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif">rsync -<b>aP</b> </span><span style="font-family:Arial,Helvetica,sans-serif"><b>--log-file=FILE</b>  </span><span style="font-family:Arial,Helvetica,sans-serif">/media/$USER/rsync/</span><span style="font-family:Arial,Helvetica,sans-serif"> $HOME/</span></div></div><br class="gmail-Apple-interchange-newline"></div></div></blockquote><div class="gmail_quote"><div><br></div><div class="gmail_default" style="font-family:monospace">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.</div></div><br clear="all"><div><div class="gmail_default" style="font-family:monospace">HTH</div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>--<br></div><div>Arun Khan</div></div></div></div>