18 lines
481 B
Bash

#!/bin/bash
backup_type=$1
backup_dir="/mnt/backup/26097"
source_dir="/home"
if [ "$backup_type" == "incremental" ]; then
for userdir in /home/*; do
rdiff-backup --exclude="$userdir/Maildir" $source_dir "$backup_dir/othinc"
done
elif [ "$backup_type" == "mirror" ]; then
for userdir in /home/*; do
rsync -va --exclude="$userdir/Maildir" $source_dir "$backup_dir/othmir"
done
else
echo "Napaka: Neveljaven način izdelave kopije."
exit 1
fi