mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
add rsync-backup script for incrementall backups
This commit is contained in:
parent
5167cffb05
commit
f9469a99f5
2 changed files with 34 additions and 0 deletions
32
usr/bin/rsync-backup.sh
Executable file
32
usr/bin/rsync-backup.sh
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# copy-mointpoint.sh - copy recursivly a mountpoint using tar
|
||||||
|
# by Tobias Powalowski <tpowa@archlinux.org>
|
||||||
|
# usage(exitvalue)
|
||||||
|
# outputs a usage message and exits with value
|
||||||
|
APPNAME=$(basename "${0}")
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
echo "RSYNC BACKUP:"
|
||||||
|
echo "- Copy backupdir to backupdestination using rsync."
|
||||||
|
echo ""
|
||||||
|
echo "- For system backup start with full mounted system and then invoke this script"
|
||||||
|
echo " with system's root directory as backupdir."
|
||||||
|
echo " - excluded directories are /dev /tmp /proc /sys /run /mnt /media /lost+found"
|
||||||
|
echo " - --numeric-ids option is invoked to preserve users"
|
||||||
|
echo ""
|
||||||
|
echo "usage: ${APPNAME} <backupdir> <backupdestination>"
|
||||||
|
exit $1
|
||||||
|
}
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
usage 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
BACKUPDESTINATION="${2}"
|
||||||
|
BACKUPDIR="${1}"
|
||||||
|
|
||||||
|
rsync -aAXv --numeric-ids --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} $BACKUPDIR $BACKUPDESTINATION
|
||||||
|
|
|
@ -84,6 +84,8 @@ build ()
|
||||||
|
|
||||||
### add copy-mountpoint.sh
|
### add copy-mountpoint.sh
|
||||||
add_file "/usr/bin/copy-mountpoint.sh"
|
add_file "/usr/bin/copy-mountpoint.sh"
|
||||||
|
### add rsync-backup.sh
|
||||||
|
add_file "/usr/bin/rsync-backup.sh"
|
||||||
|
|
||||||
### add pam
|
### add pam
|
||||||
apps="mkhomedir_helper pam_tally pam_tally2 pam_timestamp_check unix_chkpwd unix_update"
|
apps="mkhomedir_helper pam_tally pam_tally2 pam_timestamp_check unix_chkpwd unix_update"
|
||||||
|
|
Loading…
Reference in a new issue