Skip to content

Bash script which allows to backup files. It creates an compressed archive.

License

Notifications You must be signed in to change notification settings

piotrkurylak/bash-script-backup-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

bash-script-backup-files

Bash script which allows to create compressed archive.

Requirements

Due to create lock file you have to have superuser privileges.

Variables

Name of lock file.

lock_file_name="${0}.lock"

Directory where to store lock file.

lock_file_path="/var/lock/"

Full lock file path.

lock_file="${lock_file_path}${lock_file_name}"

Directory to backup.

backup_dir="${1}"

Suffix of backup file name.

backup_file_name="backup.tar.gz"

Full name of backup.

backup_full_name="$(date +%F-%H-%M)"."${backup_file_name}"

How to use it?

sudo ./backup_files.sh [FILE/DIR...]

Example

sudo ./backup_files.sh /tmp

About

Bash script which allows to backup files. It creates an compressed archive.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages