Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Scenario:
2 Ubuntu Server: 1 is named as tendo-Srv with an ip address of 192.168.1.190, from which we want to take backup and 1 is named as tendo-backup with an
ip address of 192.168.1.177, on which we want to place our backup. But we want all this process automatic, at a defined time/ interval.
ssh-keygen
Follow
scp ~/.ssh/id_rsa.pub arbab@192.168.1.177:
ssh arbab@192.168.1.177
We got an error saying “~/.ssh/authorized_keys: No such file or directory” it means that there is no .ssh directory for this user (this user has never used ssh
before). Simply create an empty .ssh directory with 700 permissions:
mkdir ~/.ssh
chmod 700 ~/.ssh
rm id_rsa.pub
Follow
Edit the ssh server configuration:
Make sure that public key authentication is enabled (it should be enabled by default), these entries must be set to yes also:
RSAAuthentication yes
PubkeyAuthentication yes
Create a directory,where we want to keep the backup on tendo-backup server and set a permission on it:
exit
Try to connect to tendo-backup server again, and this time, it will not ask for the password
ssh arbab@192.168.1.177
Follow
Create a separate directory and file, where we want to keep the rsync log on tendo-Srv and set the permission on it as well:
Where /data/ is a directory on local server(tendo-Srv) and /backup/ is directory on remote server(tendo-backup) & rsynclog.log is a log file at /rsynclog
location, where it will save the log every time after execute the command.
cat /rsynclog/rsynclog.log
cd /backup/
ls
Edit the Cron file (Special thanks to Fernando Flores, to correct the syntax of this command):
Follow
We need to configure it in such a way that it automatically take the backup at 8 p.m. everyday:
Name (required)
Email (required)
Website
Comment (required)
Submit »
Rate this:
1 Vote
Share this:
Like
Be the first to like this.
Related
File Synchronization Between Two Public-Key Authentication in SecureCRT Part-1: Creation of Hard drive image
Ubuntu Servers using Unison using Clonezilla
Linux, Ubuntu automatic backup, Automatic backup from Ubuntu Server with Rsync, backup, backup server, backup with rsync, rsync, ssh server,
ubuntu backup
Follow
← Mikrotik as Gateway Configure Mikrotik DHCP to assign ip address to only authorized client(s) →
Follow