rendered paste body#!/bin/sh
# Backup script v1.0 by Zider 2007
backupfile="/root/backup-$HOSTNAME-`date +%Y-%m-%d`.tar"
backuplist="/etc/backup.conf"
bootdev="/dev/sda"
# Makes a backup of the bootloader and partition table
dd if=$bootdev of=/etc/backup.rdb1 bs=1 count=446 2>/dev/null
dd if=$bootdev of=/etc/backup.rdb2 bs=1 count=64 skip=446 2>/dev/null
# Backup myself and the config
echo "Creating file $backupfile.."
tar -cvf "$backupfile" "$(readlink -f $0)" "$backuplist" /etc/backup.rdb1 /etc/backup.rdb2 2>/dev/null
# Backup files from config
tar -rvf "$backupfile" `cat "$backuplist"` 2>/dev/null
# Zip it up
gzip -f "$backupfile"