A set of backup scripts for backing up folders, logical volumes, mysql and postgres databases to remote hosts over ssh.

simple-backup-scripts_0.3.5-1_all.deb
simple-backup-scripts-0.3.5.tar.gz
simple-backup-scripts-0.3.5-1.noarch.rpm

usage of backup_dir.sh:

Tars and zips a directory and transfers it to a remote host via ssh. 

All files and folders underneath the directory given via '-d' will be tar'd and zip'd. Target filename for the backup on the remote host is the path given by '-d' with an appended timestamp ('/' will be replaced with '_', so /etc/kernel becomes 'etc_kernel.$timstamp.tar.gz'). 
Different predefined timestamps can be configured via the '-t' parameter. Each backup is stored in a seperate folder on the remote host, where the foldername is taken from the fully qualified domain name of the host running the backup script.
The script assumes that an ssh key for the remote host is present under '~/.ssh' and the key name corresponds to the target hostname and backup user (for backup@backup.host.de a ssh key named 'backup_backup.host.de.key' is expected). The key filename, or remote username can be overriden with '-i' and '-u'.
Errors will be logged to syslog with priority 'user.err' and info messages with priority 'user.err', logging tag is 'backup'
 
OPTIONS:
        -D      directory to backup
        -h      remote host for the backup
 
        optional:
        -u      user to use for remote host defaults to 'backup'
        -r      remote directory where to store the backup, defaults to 'pelle-Studio-1558'
        -i      ssh keyfile for the remote host, defaults to ~/.ssh/$REMOTE_HOST_$REMOTE_USER'
        -p      tcp port to use for ssh connections (defaults to '22')
        -x      creates a new passwordless ssh key and adds it to the remote hosts authorized_keys file
        -t      timestamp to use (defaults to 'now'), valid timestamps are 'now', 'daily' or 'weekly'
                now; YYYY-MM-DD_HH-MM
                hourly: hour (00..23)
                daily: day of week (1..7), 1 is Monday plus locale's full weekday name (e.g. 7_Sunday)
                monthly: month (01..12) plus locale's full month name (e.g. 1_Januar)

usage of backup_postgres.sh:

Dumps postgres databases, compresses and transfers them to a remote host via ssh. The host running the backup script and the user used for the backup either needs to be trusted in the pg_hba.conf, or a valid entry in the .pgpass (http://wiki.postgresql.org/wiki/Pgpass) muss be present. Filename for the backup is the name of the database with an appended timestamp.
Different predefined timestamps can be configured via the '-t' parameter. Each backup is stored in a seperate folder on the remote host, where the foldername is taken from the fully qualified domain name of the host running the backup script.
The script assumes that an ssh key for the remote host is present under '~/.ssh' and the key name corresponds to the target hostname and backup user (for backup@backup.host.de a ssh key named 'backup_backup.host.de.key' is expected). The key filename, or remote username can be overriden with '-i' and '-u'.
Errors will be logged to syslog with priority 'user.err' and info messages with priority 'user.err', logging tag is 'backup'
 
OPTIONS:
        -H      db host backup (defaults to localhost)
        -U      db username to use for backup (defaults to backup)
        -D      comma seperated list of databases to backup (if not set, all databases will be used)
        -S      comma seperated list of databases not to backup (if not set, all databases will be used)
        -h      remote host for the backup
 
        optional:
        -u      user to use for remote host defaults to 'backup'
        -r      remote directory where to store the backup, defaults to 'pelle-Studio-1558'
        -i      ssh keyfile for the remote host, defaults to ~/.ssh/$REMOTE_HOST_$REMOTE_USER'
        -p      tcp port to use for ssh connections (defaults to '22')
        -x      creates a new passwordless ssh key and adds it to the remote hosts authorized_keys file
        -t      timestamp to use (defaults to 'now'), valid timestamps are 'now', 'daily' or 'weekly'
                now; YYYY-MM-DD_HH-MM
                hourly: hour (00..23)
                daily: day of week (1..7), 1 is Monday plus locale's full weekday name (e.g. 7_Sunday)
                monthly: month (01..12) plus locale's full month name (e.g. 1_Januar)

usage of backup_mysql.sh:

Dumps mysql databases, compresses and transfers them to a remote host via ssh. Filename for the backup is the name of the database with an appended timestamp.
Different predefined timestamps can be configured via the '-t' parameter. Each backup is stored in a seperate folder on the remote host, where the foldername is taken from the fully qualified domain name of the host running the backup script.
The script assumes that an ssh key for the remote host is present under '~/.ssh' and the key name corresponds to the target hostname and backup user (for backup@backup.host.de a ssh key named 'backup_backup.host.de.key' is expected). The key filename, or remote username can be overriden with '-i' and '-u'.
Errors will be logged to syslog with priority 'user.err' and info messages with priority 'user.err', logging tag is 'backup'
 
OPTIONS:
        -H      db host backup (defaults to localhost)
        -U      db username to use for backup (defaults to backup)
        -P      db password
        -D      comma seperated list of databases to backup (if not set, all databases will be used)
        -S      comma seperated list of databases not to backup (if not set, all databases will be used)
        -h      remote host for the backup
 
        optional:
        -u      user to use for remote host defaults to 'backup'
        -r      remote directory where to store the backup, defaults to 'pelle-Studio-1558'
        -i      ssh keyfile for the remote host, defaults to ~/.ssh/$REMOTE_HOST_$REMOTE_USER'
        -p      tcp port to use for ssh connections (defaults to '22')
        -x      creates a new passwordless ssh key and adds it to the remote hosts authorized_keys file
        -t      timestamp to use (defaults to 'now'), valid timestamps are 'now', 'daily' or 'weekly'
                now; YYYY-MM-DD_HH-MM
                hourly: hour (00..23)
                daily: day of week (1..7), 1 is Monday plus locale's full weekday name (e.g. 7_Sunday)
                monthly: month (01..12) plus locale's full month name (e.g. 1_Januar)

usage of backup_svn.sh:

Dumps/hotcopies a subversion one ore more subversion repositories and transfers them to a remote host via ssh. 
Target filename for the backup on the remote host is the last path element of the full path to the repository with an appended timestamp.
Different predefined timestamps can be configured via the '-t' parameter. Each backup is stored in a seperate folder on the remote host, where the foldername is taken from the fully qualified domain name of the host running the backup script.
The script assumes that an ssh key for the remote host is present under '~/.ssh' and the key name corresponds to the target hostname and backup user (for backup@backup.host.de a ssh key named 'backup_backup.host.de.key' is expected). The key filename, or remote username can be overriden with '-i' and '-u'.
Errors will be logged to syslog with priority 'user.err' and info messages with priority 'user.err', logging tag is 'backup'
 
OPTIONS:
        -R      repository to backup, can be either a path to a single repository, or a path to a folder containing multiple repositories
        -T      temp directory where to store intermediary files when using hotcopy backup type
        -E  backup type to use (defaults to 'dump')
                dump            dump the contents of the repository in a portable format (see http://svnbook.red-bean.com/en/1.5/svn.ref.svnadmin.c.dump.html)
                hotcopy         full “hot” backup of your repository, including all hooks, configuration files, and, of course, database files (see http://svnbook.red-bean.com/en/1.5/svn.ref.svnadmin.c.hotcopy.html)
        -h      remote host for the backup
 
        optional:
        -u      user to use for remote host defaults to 'backup'
        -r      remote directory where to store the backup, defaults to 'pelle-Studio-1558'
        -i      ssh keyfile for the remote host, defaults to ~/.ssh/$REMOTE_HOST_$REMOTE_USER'
        -p      tcp port to use for ssh connections (defaults to '22')
        -x      creates a new passwordless ssh key and adds it to the remote hosts authorized_keys file
        -t      timestamp to use (defaults to 'now'), valid timestamps are 'now', 'daily' or 'weekly'
                now; YYYY-MM-DD_HH-MM
                hourly: hour (00..23)
                daily: day of week (1..7), 1 is Monday plus locale's full weekday name (e.g. 7_Sunday)
                monthly: month (01..12) plus locale's full month name (e.g. 1_Januar)

usage of backup_lvm.sh:

Creates a snapshot for an logical volume, compresses and transfers it to a remote host via ssh. Target filename is the name of the volume group combined with the logical volume name and a timestamp.
Different predefined timestamps can be configured via the '-t' parameter. Each backup is stored in a seperate folder on the remote host, where the foldername is taken from the fully qualified domain name of the host running the backup script.
The script assumes that an ssh key for the remote host is present under '~/.ssh' and the key name corresponds to the target hostname and backup user (for backup@backup.host.de a ssh key named 'backup_backup.host.de.key' is expected). The key filename, or remote username can be overriden with '-i' and '-u'.
Errors will be logged to syslog with priority 'user.err' and info messages with priority 'user.err', logging tag is 'backup'
 
OPTIONS:
        -L      logical volume to back up
        -G      volume group where the logical volume resides
        -S      size for the snapshots, M for megabytes, G for gigabytes, T for terabytes, P for petabytes or E for exabytes is optional. Default unit is megabytes (default is '8G')
        -h      remote host for the backup
 
        optional:
        -u      user to use for remote host defaults to 'backup'
        -r      remote directory where to store the backup, defaults to 'pelle-Studio-1558'
        -i      ssh keyfile for the remote host, defaults to ~/.ssh/$REMOTE_HOST_$REMOTE_USER'
        -p      tcp port to use for ssh connections (defaults to '22')
        -x      creates a new passwordless ssh key and adds it to the remote hosts authorized_keys file
        -t      timestamp to use (defaults to 'now'), valid timestamps are 'now', 'daily' or 'weekly'
                now; YYYY-MM-DD_HH-MM
                hourly: hour (00..23)
                daily: day of week (1..7), 1 is Monday plus locale's full weekday name (e.g. 7_Sunday)
                monthly: month (01..12) plus locale's full month name (e.g. 1_Januar)