Schlagwort-Archive: partimage

partimage automatisieren

#! /bin/bash
# Startwerte setzen
src_part=hda2
dst_part=hdb3
path="backup/sysbackup"
# Zielpartition mounten 
mkdir /mnt/$dst_part
mount /dev/$dst_part /mnt/$dst_part
echo Wait for /dev/$dst_part to be mounted ...
while [ ! -d "/mnt/$dst_part/$path" ]; do
  sleep 1
done
# Backup starten
datum=`date +%y%m%d`
partimage -z1 --volume 2085888 -b -f3 save /dev/$src_part /mnt/$dst_part/$path/sysbackup_$datum
# Zielpartition unmounten
echo Wait for /dev/$dst_part be unmounted ...
while [ -d "/mnt/$dst_part/$path" ]; do
  umount /dev/$dst_part
  sleep 1
done
rm -rf /mnt/$dst_part
# System neu starten
echo Restarting system ...
reboot