Skip to content

Instantly share code, notes, and snippets.

@wopfel
Last active December 28, 2015 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wopfel/7497936 to your computer and use it in GitHub Desktop.
Save wopfel/7497936 to your computer and use it in GitHub Desktop.
A tiny backup script using CloneZilla Live 2.1.2.-43. The output directory is named dynamically (YYYY-MM-DD_HHMMSS-img-...) and created under /home/partimag by ocs-sr. The first three partitions are backed up (sda1, sda2, and sda3).

Steps

  • Boot from Clonezilla Live CD
  • Select "Clonezilla live" (default entry in boot menu)
  • Choose keyboard language
  • Select "Enter shell"
  • Choose "cmd" mode
  • If the script resides on /dev/sdb1, then "mount /dev/sdb1 /home/partimag" now (the mount inside the script will fail, but that doesn't matter)
  • Run script ("sudo ...")
#!/bin/bash
SYSTEM=AcerAspire7750G
HOSTNAME=erdmaennchen
# No modification needed beyond this point
TIMESTAMP=$( date +%Y-%m-%d_%H%M%S )
DESTNAME=$TIMESTAMP-img-$SYSTEM-$HOSTNAME
echo "$TIMESTAMP -- $DESTNAME"
mount /dev/sdb1 /home/partimag
/usr/sbin/ocs-sr -q2 -c -j2 -z1p -i 2000 -sc -p true saveparts $DESTNAME sda1 sda2 sda3
cp /var/log/clonezilla.log /home/partimag/$DESTNAME/
du -hs /home/partimag/$DESTNAME/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment