1

[SOLVED] bash help: rsync only if device mounted

view story
linux-howto

https://bbs.archlinux.org – OK, a little bit later than I should have replied, but I have incorporated the tips provided above, I have added an extra check for the target dir and I have applied general exit codes:#!/bin/bash ## ## VARIABLES ## # Set source location BACKUP_FROM="/srv/media/" # Set target location BACKUP_TO="/media/backup/media/" BACKUP_DEV="xxxxxxx-xxxxx-xxxxxxxxxxxxxxx" #UUID of the disk BACKUP_MNT="/media/backup" # Log file LOG_FILE="/var/log/script_sync_media.log" ## ## SCRIPT ## # Check that the log file exists if [ ! -e "$LOG_FILE" ]; (HowTos)