19 lines
532 B
Bash
19 lines
532 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 --include="$userdir/Maildir" --exclude="$userdir/*" $source_dir "$backup_dir/criinc"
|
|
done
|
|
|
|
elif [ "$backup_type" == "mirror" ]; then
|
|
for userdir in /home/*; do
|
|
rsync -va --include="$userdir/Maildir" --exclude="$userdir/*" $source_dir "$backup_dir/crimir"
|
|
done
|
|
else
|
|
echo "Napaka: Neveljaven način izdelave kopije."
|
|
exit 1
|
|
fi |