diff options
Diffstat (limited to 'share')
-rwxr-xr-x | share/hydractl/sync-backups | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/share/hydractl/sync-backups b/share/hydractl/sync-backups index c04fa2f..b218b5c 100755 --- a/share/hydractl/sync-backups +++ b/share/hydractl/sync-backups @@ -64,6 +64,18 @@ else shift fi +# Check volume name +if [ "$VOLUME" == "`hostname -f`" ]; + echo "volume is the hostname, cannot sync to myself" + exit 1 +fi + +# Check if it is mounted +if ! mount | grep -q $MEDIA; then + echo "volume $MEDIA is not mounted" + exit 1 +fi + # Detect if removable media is a system or a regular storage volume if [ -d "$MEDIA/var/backups/remote" ]; then MEDIA="$MEDIA/var/backups/remote" |