#!/bin/bash LOCK="/usr/scheduler/backup-html.lock" if [ -f "$LOCK" ]; then echo "Another instance of $0 is running, exiting..." exit 1 fi touch $LOCK # Creates the file trap "rm $LOCK" EXIT echo "Begining backup of HTML files..." #if [ -f "/srv/backup/html/html.tar.gz" ]; then # echo "Rotating existing backup files..." # logrotate /usr/scheduler/logrotate_backup_html #fi #echo "Creating tar gzip archive..." #tar -zcf /srv/backup/html/html.tar.gz /srv/data/html/ rsnapshot daily echo "Backup finished!"