Here is a simple script to make a back up copy of your “home” directory.
Why backup your home directory? because most of your configuration files are in your home directory as , files (dot files). Your Bookmarks and preferences for Firefox are in your home dir. If you are using ssh on your lan, your ssh keys are in your home directory. So if I’m playing around and stupidly do something that trashes Antergos, I simply re-install Antergos. Then i unzip my back up home directory to a thumb drive, a NAS, or my Antergos based file server. Then copy everything from the back up home dir to the new home dir and tell it to overwrite all existing files with the same name. Bingo, you are pretty much back to where you were at the time of your last backup.
There are two things I know of that cannot be salvaged this way. Your E-mails, contacts, etc if your are using Evolution as a mail client. Also your Chromium bookmarks. To solve this, before I make a backup in Evolution I use the “Back up Evolution data…” function and save it somewhere in my home directory. In Chromium, I use the “Export bookmarks” function and save to my home directory. Then after the backup is unzipped, use the restore function in Evolution and Chromium to restore from these files.
Of course, the whole idea is for this home directory back up file to exist somewhere on another device besides the SSD or Hard Drive containing your Antergos OS.
#This file creates and gzips a backup of your home directotory in a tarball
#The following variable represents the pathname where the
#backup .tar.gz files will be placed
#DO NOT put a / on the end of PATHNAME i.e. /home/don/ is incorrect
#In the case below, the backup file will be placed on my Antergos server in a #directory named "HomeBkup. /home/don/Server is a mount point for my #Antergos LAN server. Change this to suit your needs.
#create new backup filename as HomeBkup-MoDaYear
#create new backup file
tar --create --verbose --exclude=/home/don/Server --exclude=/home/don/OdroidServer --gzip --file=$PATHNAME/$FILENAME.tar.gz /home/don
Have fun experimenting.
The “/home/don” at the end of the tar command is the directory to be saved (target directory) in this case my home directory /home/don.
You can customize how much data is being saved and therefore how big your back up file will be by using the --exclude option. In my case, /home/don/Server and /home/don/OdroidServer are mount points for two servers on my lan. I back them up by other means so no need to back them up as part of my home directory. So, I exclude them.
If you have other means for backing up your Documents directory, Music directory, Pictures directory, etc. you can exclude them from your backup. You can use as many excludes as you like. i.e.
–exclude /home/don/Music --exclude /home/don/Pictures