I have some problem with bash script. I need to add some content to it. My script need to run at a certain time but I don't know how to do that. It should work like this: I have a variable then I assign a time like 3200s. When I run the program, then the script will create backups every 3200s but only if some files changed. What am I doing wrong?
!/bin/bash
SOURCE="/var/www/my_web/load/"
BACKUP="/home/your_user/load/"
LBACKUP="/home/your_user/load/latest-full/"
DATE=$(date +%Y-%m-%d-%T)
DESTINATION="$BACKUP"/"$DATE"-diff/
rsync -av --compare-dest="$LBACKUP" "$SOURCE" "$DESTINATION"
cd "$DESTINATION"
find . -depth -type d -empty -delete