Linux Server Backup Best Practices With Command Crontrab




Backup server with the command "scp" or "rsync" automatically in linux with the command crontab.

To backup automatically there are a few requirements must be met:
1. Computer backup and main computer have the same login.
For example, in "server computer is no EXAMPLE login". In the "main computer also must have EXAMPLE login".

2. The Ip address must be in the recommend
e.g. "his or her main computer ip address 173.15.52.1"
And "computer backup 173.15.52.2"

On the computer should be introduced to the main ip address of computer backup.
By the way:

vi /etc/hosts



Fill with
173.15.52.2 EXAMPLE2
Then save it with the command: wq!

And also the contents in the file
vi /etc/hosts.equiv

Fill with
example2
Then save


Likewise, in computer backups should be introduced
By the way:

vi /etc/hosts
 

Fill with
173.15.52.1 EXAMPLE1
Then save it with the command: wq!


And also the contents in the file
vi /etc/hosts.equiv

Fill with
example1
Then save


3. Who should definitely connect with the network

4. Chmod 777 to backup server
By the way
From root#
Chmod 777 /home/EXAMPLE

After the above step lived we make commands for data backup.
We create conditions to our backup server computer that runs the command.

1. For example, the command to backup the data we store on file "take data" on tour-login
Here's how
– from login: EXAMPLE
Password:

With the command scp
vi take data

scp -C -r 173.15.52.1:/home/example/*
Then save.

With rsync command
rsync –progress -avz 173.15.52.1:/home/example/*

Then save
For the Select command with rsync or scp

Run chmod 777 take data
to test the command take data type
sh take data
If the command path then the backup server will copy the data from the main server

For the final stages of making a command to copy data automatically
From the prompt type tour

From the prompt type tour
crontab -e
For example, we will backup the clock 00:01 (12 more nights 1 minute)
Type
01 00 *** /home/example/take data


good luck


Next
Previous
Click here for Comments

0 comments: