Skip to content

Backup File/Directory to tar.gz file with timestamp and show compression in progress.

License

Notifications You must be signed in to change notification settings

MadHatterENV/Backup_Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Backup a folder !

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.

Version

  • 📘 Currently version 1.00

Usage / Getting Started

💡 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.

Installation & prerequisites

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.

Optional system-wide availability

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

You can change your .profile to include ~/.local/bin/

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

Coded with

  • All my code are coded/debugged with VS Code.

Versioning

:octocat: We use SemVer for versioning.

Author(s)

This script was only written by ⚡ MadHatter4²

License

This project/code/script is licensed under the ©️ MIT license

Acknowledgement

About

Backup File/Directory to tar.gz file with timestamp and show compression in progress.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages