aboutsummaryrefslogtreecommitdiffstats
path: root/stromboli_backup
blob: 91bb76311ed7ff3203b1c7b3bfe8ede524200d48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/zsh
# Backup script for stromboli. This synchronises stromboli's local storage with the NFS data from vesuvio.

BACKUP_LOCK="/tmp/backup_in_progress"

# Do not attempt to backup if there is already a backup happening (it probably means something is wrong)
if [[ -e "$BACKUP_LOCK" ]]; then
    # TODO notify somehow (email?)
    exit 1
fi

# Create backup lock file
echo "Doing backup..." > "$BACKUP_LOCK"

# Do backup
/home/eddy/bin/backup vesuvio: /home/eddy/backup
sync

# Backup was successful, remove lock
rm "$BACKUP_LOCK"