How to best make a backup of ONLY my home folder?

Today I’m expecting a brand new computer. A Tuxedo computer.

Now, on my current computer I’m running Linux Mint 22.2.

How do I best backup my HOME directory completely, including all the dotfiles and dotdirectories. I’m especially interested in keeping my firefox configuration, but there’s also quite some documents on there I wish to keep.

I’d either need to import it in TuxedoOS or a new install of Linux Mint, depending on how used I got to cinnamon.

3 Likes

I have scripts for creating tarballs, one for the entire $HOME and another for Waterfox and Thunderbird.

3 Likes

I would not use backup, but instead put a usb or external disk connected to your machine then use copy or drag and drop the home folder onto the external device.

Then drag and drop each folder content into your new machine.

Dont personally like backup and restore.

For firefox use export then import on new computer. Not sure what you use on firefox but I am a google user, I just signed in and everything transférer automatically from my phone tablet and my older linux box.

2 Likes

This is what I use to back up my /home directory.

=========================================================================

#This command backs up the entire /home folder to an external SSD
#Could add --exclude ‘.config/BraveSoftware/Brave-Browser’

rsync -av --exclude ‘.local/share/gvfs-metadata’ --exclude ‘.local/share/Trash’ --exclude ‘.cache’ --exclude ‘snap’ --exclude ‘.config’ /home/don /media/don/AI-300-Backup/AI-300-Backup

echo " "
date
echo " "

=======================================================================

I put this into a BASH script I call “mybackup”, put it somewhere that’s in the PATH, and made it executable.

Because rsync does a differential backup (i.e., only backs up what’s changed since the last backup) the procedure is very quick.

Now and then I erase the backup file on the external SSD and make a fresh copy. (rsync does not by default erase files in the destination drive even though they’ve been erased from the source. That’s why an occasional fresh backup is a good idea.)

4 Likes

Far too much work, IMHO, and rather error-prone.

3 Likes

This is undoubtedly why I prefer complete snapshots over incremental savesets. For me, speed is no issue.

3 Likes

My prefered way. Especially as going from one system to another may use different software or versions. Also If I want just one file or image I can just get that with backup and restore its harder.

We each have our own system of work and prefered methods, mine is old school but never let me down and my first computer job was over 50 years ago and thats what I was told to do for tye same reasons

2 Likes

I use rsync in archive mode.
Every night before I finish I rsync my workfile area to a partition on another disk. It can be any disk, internal or external, even a flash drive, but best not the disk your home directory is on.
It is fast because rsync does not use compression.
You get an exact duplicate of the home filesystem, so it is easy to retrieve one item if you need.

I notice @don.karon does the same thing.
but
@abu prefers snapshots

5 Likes

I heard about a utility called ‘mackup’ on a podcast. It was originally used on Macs but works on Linux.

2 Likes

Tools come and go. But I consider tar and zip as constants until hell froze over. :wink:

4 Likes

yes, they are part of the GNU utilities (and also the bsd utilities)… they should also be part of POSIX.

2 Likes

Thats why I use full copy system no tools needed just file manager

2 Likes

I never backup my $HOME…

Not bothered about .dot files or folders…

The only folder I mainly use in my $HOME is ~/Downloads - and that’s not important to keep… I can always download that shit again…

Everything else in $HOME is a symlink to my ResilioSync shares in ~/ResilioSync - the contents of which are shared across 6-11 computers… (there’s at least 11 sharing my shell scripts - 6 my documents [including pictures / photos] and music (which itself is a subset of the 1 TB music I store on my NAS)…

i.e. Music, Documents, Pictures, ~/bin is a symlink to ~/ResilioSync/scripto/bin …

But I do run backups of my Raspberry Pi “servers” - using rsync to refresh update a backup folder - then tar czvpf to backup those folders - via crontab on one of the RPi - to an external 6TB USB 3 hdd - that 6TB drive is also a backup target for Apple TimeMachine (my personal MacBook and one of my daughter’s MacBooks).

root’s crontab on the Pi4 “server” :
0 4 * * 0 /usr/local/bin/bk-rpi.bash > /dev/null 2>&1

#!/usr/bin/env bash
# backup this RPi 
# use rsync to dump to backups, then use tar to archive content of backups to tgz file in archives
# RUNTIME=$(date +'%Y%m%d-%H%M')
PROG=$(basename "$0")
BOX=$(uname -n)
RUNTIME=$(date +'%Y%m%d')
EXL="/usr/local/bin/elx2.txt"
# elx2.txt
ARSYDIR=/mnt/BUNGER00/backups/$BOX
TURDIR=/mnt/BUNGER00/archives
# Returdation = 15 days : 
RETURD=15
[[ ! -d $ARSYDIR ]] && mkdir $ARSYDIR
[[ ! -d $TURDIR ]] && mkdir $TARDIR
# Exclude list e.g. (actually more in elx2.txt above)
# /backup
# /home/x/ResilioSync
# /proc
# /sys
# /dev
set -vx
rsync -av --exclude-from=$EXL / $ARSYDIR/.
tar czvpf $TURDIR/bkup-$BOX-$RUNTIME.tgz $ARSYDIR/*

And the exclusion list file :

root@frambo:~# cat /usr/local/bin/elx2.txt
/mnt/BUNGER00/backups
/mnt/BUNGER00/archive
/home/x/ResilioSync
/home/x/Resilio\ Sync
/home/x/.cache
/home/x/.config
/home/x/.local
/home/x/.steam
/home/x/.oh-my-zsh
/home/x/.kodi
/home/x/tmp
/proc
/sys
/dev
/mnt
/media
/var/spool
/var/tmp
/var/lib/snap
/var/lib/snapd
# /var/lib/plexmediaserver
/boot
/run
/snap
/swapfile
/tmp

If I ever came across a Linux system that didn’t have tar and gzip - I’d dump it… Find something else… Even MacOs has them… FreeBSD… Solaris… even rsync is fairly ubiquitious (nearly always installed by default) - perhaps not on Solaris though…

The blesssed thing about rsync - if it bombs out - you can kick it off again and it should resume… Try that with a drag and drop file manager… :smiley: Pretty sure there’s a GUI frontends for rsync - but I wouldn’t use it…

5 Likes

All your email is in a dot file.
Stupid place to put it in my opinion… I suppose it can be changed.

3 Likes

Mine isn’t - I don’t use a fat client for ANY email… I use a web client… e.g. GMail in a web-browser - MS Outlook on MS-Edge…
I do have imap enabled in my Gmail - I sometimes (when I remember) fire up the MacOS email client and let it get my stuff… But I hardly ever…
I also often check my inbox in the Gmail app on my Samsung Galaxy phone…

2 Likes

I assume the idea behind it is that a user doesn’t have to touch the email profile. Same for the browser. BTW.

1 Like

I was using mutt for a while. But as nowadays nearly all mails arrive in HTML format, it was never a real pleasure.

1 Like

I have several of these. Recommend the new injection :joy:

3 Likes

With multiboot, I have to be careful to only save emails to folders in one distro… otherwise it get scattered .
It is the saved folders that I care about… not the incoming stream.

Yes browsers have the same issues, but there is not much browser data that I care about. I can survive without my bookmarks.

2 Likes

So how and where do you save valuable emails?

1 Like