Results > Posts Filed Under > Backup

Rsync backup script

#!/bin/bash
## Rsync File Backup Script
## Version 0.1
## License pending
##
## This script PULLS backups. It should be run on the server
##storing the backups.
##
## You need to create a ssh keypair between the two servers
## for this to work properly!
##

## Variables go here!
# Exclude line
# (Must be in the format of: ” –exclude file1 –exclude dir1″ etc.)
exclude=” –exclude aquota.user –exclude vpopmail”

# rsync switches (see rsync –help or man rsync for more information)
rswitch=” –archive –delete –compress -vv –rsh=ssh”

# Local backup …

Backup script

#!/bin/bash
## RSFBS – Really Simple File Backup Script
##
## Version 0.5
##

## Variables go here!
# General base backup directory, All the subdirectories will be
# created under here.
basedir=/backup

# Let’s name our backup file, the date will be appended to this
backupname=domain-files

# Network Attached Storage Directory. This could be
# anywhere, but we keep it under the basedir to keep Tengu sane.
# If you don’t have a NAS or NFS drive, leave this blank.
nasdir=$basedir/nas

# Target Directory to backup
backupdir=/home/domain/public_html

# How many backups do we want to keep? …

backup server configuration-Rsync setup

Backup script for configuring remote backup on linux/unix servers.
#!/bin/bash
rsync -ave ’ssh -p 5779′/etc root@192.168.0.1:/backup/folder/
rsync -ave ’ssh -p 5779′/var root@192.168.0.1:/backup/folder/
rsync -ave ’ssh -p 5779′/usr root@192.168.0.1:/backup/folder/
rsync -ave ’ssh -p 5779′/home root@192.168.0.1:/backup/folder/
rsync -ave ’ssh -p 1024′ /etc root@192.168.0.1:/backup/folder/
using rsync for a server having no ssh port.
======================================================
rsync -ave ssh /etc root@192.168.0.1:/backup/folder/
======================================================
ssh-keygen -t dsa
scp ~/.ssh/id_dsa.pub root@192.168.0.1:/root/.ssh/server1.key.pub
ON BACKUP SERVER
cat /root/.ssh/server1.key.pub >> /root/.ssh/authorized_keys2

 Page 2 of 2 « 1  2