Rsyncas is a project mainly written in ..., based on the WTFPL license.
rsync auto script
Yes, i was running out of ideas for the name
This software is licensed under the highly restrictive DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2.0 or later. If this license doesn't suit you: you're doing it wrong.
Sync files. Yes its just a rsync automator. I use it to backup my servers
curl https://github.com/hugorodrigues/rsyncas/raw/master/rsyncas > /usr/bin/rsyncas
chmod +x /usr/bin/rsyncas
curl https://github.com/hugorodrigues/rsyncas/raw/master/rsyncas.example.conf > /etc/rsyncas.conf
vim /etc/rsyncas.conf
Note: You can use/install rsync without root, just change /usr/bin/rsyncas to ~/rsyncas/rsyncas and /etc/rsyncas.conf to ~/rsyncas/rsyncas.conf
curl https://github.com/hugorodrigues/rsyncas/raw/master/rsyncas > /usr/bin/rsyncas
First you define a backup setting like:
$bck['mybackup'] = array(
'description' => 'This is the description of your backup conf',
'pre_cmd' => 'someCommandToExecute_BEFORE_Sync.sh',
'source' => '/my/local/folder/to/backup/',
'destination' => '[email protected]:/some/folder/',
'post_cmd' => 'someCommandToExecute_AFTER_Sync.sh'
);
and then to backup that setting you run:
$ rsyncas mybackup
You can have multiple settings, and run them all:
$ rsyncas --all
You may also define setting in runtime:
$ rsyncas source='/some/folder/' destination='[email protected]:/some/folder/' description='My descrition'
Backup a webserver:
$bck['www'] = array(
'description' => 'Backup http root',
'source' => '/var/www/',
'destination' => '[email protected]:/backups/www/'
);
To backup this "www" setting:
$ rsyncas www
Backup a Mysql Server:
$bck['mysql'] = array(
'description' => 'Mysql Backup',
'pre_cmd' => 'mysqldump --opt mydatabase > /tmp/mysql/mydatabase.sql',
'source' => '/tmp/mysql/',
'destination' => '[email protected]:/backups/mysql/',
'post_cmd' => 'rm /tmp/mysql/mydatabase.sql'
);
To backup this "mysql" setting:
$ rsyncas mysql
Mirror a website:
$bck['mirror'] = array(
'description' => 'Server Mirror',
'source' => '/var/www/',
'destination' => '[email protected]:/var/www/'
);
To backup this "mirror" setting:
$ rsyncas mirror
To backup all the previous defined settings:
$ rsyncas --all
Just like you normally do. Something like:
10 2 * * * root rsyncas demoName
---------------------------------------------------------------------------
rsyncas version 0.1 | https://github.com/hugorodrigues/rsyncas
---------------------------------------------------------------------------
rsyncas comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it and/or modify it under the terms of the
Do What The Fuck You Want To Public License, Version 2.
---------------------------------------------------------------------------
Usage: rsyncas --help | useless. shows this message
or rsyncas --all | run all pre-defined configurations
or rsyncas --test | Test e-mail settings/delivery
or rsyncas key | run a specific setting
or rsyncas [OPTION] |
Options:
description= | description of the sync
source= | source target
destination= | destination target
ssh_port= | alternative ssh port
pre_cmd= | command to execute before sync
post_cmd= | command to execute after sync
Examples:
rsynca mybackup | run the pre-defined "mybackup" configuration
rsynca --all | run all pre-defined configurations