System backup 1

My scripts >
The 1st script below is for creating a backup archive of a running linux system.
While the 2nd is for creating a backup archive of user's home.

See my System backup page for more info.

1. backup system
(name it bkpsys for example)
 

The excludes are added via the bash array, ${X[@]}, as a simple variable won't work, but you can also use a file with excludes listed one per line and call it with --from-file filename
The resulting tar file will be time-stamped with the day's date/time.
A choice of tar xz or tar with zstd is included! Just set a hash by the tar command you don't want to run.
Set the 1st CMT variable to whatever comment you want to append to the file name (or leave it blank).


2. backup home
(name it bkphome for example)
 

Using "$HOME" will backup the logged-in user, whereas "/home" will backup all users. Omit "sudo" here so as not to backup the root $HOME!