consolidate all repos to one for archive
This commit is contained in:
18
semester_4/sistemska_administracija/Naloga_5/backup-other.sh
Normal file
18
semester_4/sistemska_administracija/Naloga_5/backup-other.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user