A simple script that compresses files/folders and moves them to a backup location
Install script dependencies via install
argument.
$ sudo ./backup.sh install
Thanks to WSL
, you can run bash scripts on windows!
In order to add backups, you need to create a separate config file.
$ ./backup.sh setup
You can load the config file by adding its path after backup
: backup <path-to-config>
$ ./backup.sh <path-to-config>
You can have as many config files as you like (this could be used to run different backups)
$ ./backup.sh <path-to-config>
- Open the config file (
backup-config.sh
) and find theENTER FOLDERS TO BACKUP HERE
text - Add a file/folder by following the syntax guide below
# ENTER FOLDERS TO BACKUP HERE
##############################
# backup "name-of-folder" "/directory-of-parent-folder/" "/directory-of-parent-backup-folder/"
# backup "profile-images" "/my/images/" "/my/backup/google-drive/images/"
backup "name of file/folder" "full path to folder" "full path to backup location"
# Lets try a more real example
# We are backing up a folder called "music" that exists in our "documents" folder
# This is then packaged up and moved to the "backup" directory
backup "music" "/home/user/documents/" "/home/user/backup/documents/"
# Original "/home/user/documents/music/"
# Backed-up "/home/user/backup/documents/music.tar.gz"