This script will backup a given folder to a .tar.gz file and display the progress on the terminal.
Currently flawless running on a Debian 10 system.
Using pv
to show the progress of compression/completion of the script.
Using gzip
, tar
to compress the files/directories to a .tar.gz file in the current folder.
- 📘 Currently version 1.00
💡 Simple run the following command to backup a given folder:
./backup.sh /path/to/folder
This will generate a file called Backup_YYYYmmdd_hhmm_ss_DayOfTheYear.tar.gz
in the current folder.
Just clone this repo or download the backup.sh
script, add the execute permission (chmod +x backup.sh
), check if you've installed pv
(sudo apt-get install pv
on Ubuntu/Debian) , (sudo yum install pv
on CentOS) and you're good to go.
If you want to just run backup /my/folder
copy the backup script to the standard folder:
sudo cp ./backup.sh /usr/local/bin/backup
STEP1
Add following code to the .profile file in your home directory
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
STEP2
sudo cp ./backup.sh /home/yourusername/.local/bin/backupdir
cd /home/yourusername/.local/bin/backupdir
sudo chmod +x backupdir
- All my code are coded/debugged with VS Code.
We use SemVer for versioning.
This script was only written by ⚡ MadHatter4² ⚡
This project/code/script is licensed under the ©️ MIT license
- Hat tip to the guys and girls who maintain the
man date
:) - Badges generated with shields.io
- Emojo Cheatsheet | cheatlist
- Markdown Cheatsheet | Github Mastering
- Markdown Guide
- Code Sandbox