Rsync (Remote Sync) is a most commonly used command for copying and synchronizing files and directories remotely as well as locally in Linux/Unix systems.
To take a backup of any file through Rsync we need following things :
- Cpanel Username
- Website IP
- Full path
- Cpanel Password
Steps to take a BackUp
Step 1: Create a localpath in your system with your website name or any other.
Step 2: Copy and paste the command below in your editor:
Rsync command :
echo “Example Website”
rsync -razP [email protected]:/remote file/. /localpath/ ( To save file)
echo “Example Website BackUp Done”
-r “recursive” recurse into directories
-a “archive” archive mode
-z “compress” compress file data during the transfer
-P “permissions” same as –partial –progress
Now edit the username, IP, remote file and localpath accordingly and save it.
Step 3: Now open the terminal at the location of the file (ex : the folder in which it is saved the file.)
Step 4: Now run the below-mentioned command in the terminal :
Command – chmod +x ./(filename)
Step 5: In next step run the command mentioned below:
Command – ./(filename)
After running the command you will asked for the password, enter the Cpanel password and you are done.
All files are saved in your local path.