Bash script which allows to create compressed archive.
Due to create lock file you have to have superuser privileges.
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}"
sudo ./backup_files.sh [FILE/DIR...]
sudo ./backup_files.sh /tmp