<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://serverrental.store/index.php?action=history&amp;feed=atom&amp;title=Setting_Up_Automated_Backups_with_rsync</id>
	<title>Setting Up Automated Backups with rsync - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://serverrental.store/index.php?action=history&amp;feed=atom&amp;title=Setting_Up_Automated_Backups_with_rsync"/>
	<link rel="alternate" type="text/html" href="https://serverrental.store/index.php?title=Setting_Up_Automated_Backups_with_rsync&amp;action=history"/>
	<updated>2026-04-14T21:21:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://serverrental.store/index.php?title=Setting_Up_Automated_Backups_with_rsync&amp;diff=5843&amp;oldid=prev</id>
		<title>Admin: New server guide</title>
		<link rel="alternate" type="text/html" href="https://serverrental.store/index.php?title=Setting_Up_Automated_Backups_with_rsync&amp;diff=5843&amp;oldid=prev"/>
		<updated>2026-04-14T10:02:36Z</updated>

		<summary type="html">&lt;p&gt;New server guide&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Setting Up Automated Backups with rsync =&lt;br /&gt;
&lt;br /&gt;
This guide provides a comprehensive walkthrough for setting up automated backups for your server using the powerful `rsync` utility. We will cover creating robust `rsync` scripts, automating their execution with `cron`, and demonstrating how to transfer backups to a remote server for enhanced data safety. This is crucial for maintaining data integrity and ensuring business continuity in the event of hardware failure, accidental deletion, or security breaches.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Before you begin, ensure you have the following:&lt;br /&gt;
&lt;br /&gt;
*   A Linux server with root or sudo privileges. For reliable hosting with full root control, consider dedicated servers at [https://powervps.net/?from=32 PowerVPS].&lt;br /&gt;
*   SSH access to your server.&lt;br /&gt;
*   Basic understanding of the Linux command line.&lt;br /&gt;
*   A separate server or storage location for your backups (the &amp;quot;backup server&amp;quot;). This can be another dedicated server, a VPS, or even a NAS device accessible via SSH.&lt;br /&gt;
&lt;br /&gt;
== Understanding rsync ==&lt;br /&gt;
&lt;br /&gt;
`rsync` is a versatile file-synchronization utility that efficiently transfers and synchronizes files between two locations. Its key advantages include:&lt;br /&gt;
&lt;br /&gt;
*   ''Delta-transfer algorithm'': `rsync` only transfers the *differences* between files, making it extremely efficient for subsequent backups.&lt;br /&gt;
*   ''Preservation of permissions, ownership, timestamps'': It can maintain file metadata, crucial for restoring systems accurately.&lt;br /&gt;
*   ''Compression'': Can compress data during transfer, saving bandwidth.&lt;br /&gt;
*   ''Remote and local synchronization'': Works seamlessly between local directories and remote servers via SSH.&lt;br /&gt;
&lt;br /&gt;
== Creating Your First rsync Backup Script ==&lt;br /&gt;
&lt;br /&gt;
We'll start by creating a basic `rsync` script to back up a specific directory to another location on the same server. This serves as a foundational step before moving to remote backups.&lt;br /&gt;
&lt;br /&gt;
=== Script Location ===&lt;br /&gt;
&lt;br /&gt;
Create a directory to store your backup scripts:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mkdir -p /opt/scripts&lt;br /&gt;
sudo chown root:root /opt/scripts&lt;br /&gt;
sudo chmod 700 /opt/scripts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Backup Script ===&lt;br /&gt;
&lt;br /&gt;
Now, create the `rsync` script file. We'll name it `backup_home.sh` for this example, assuming we want to back up the `/home` directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo nano /opt/scripts/backup_home.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Paste the following content into the file, replacing placeholders as needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# --- Configuration ---&lt;br /&gt;
SOURCE_DIR=&amp;quot;/home/&amp;quot;&lt;br /&gt;
BACKUP_DIR=&amp;quot;/mnt/backups/home/&amp;quot; # Ensure this directory exists and has sufficient space&lt;br /&gt;
LOG_FILE=&amp;quot;/var/log/rsync_backup_home.log&amp;quot;&lt;br /&gt;
DATE=$(date +&amp;quot;%Y-%m-%d_%H-%M-%S&amp;quot;)&lt;br /&gt;
REMOTE_USER=&amp;quot;backupuser&amp;quot; # User on the remote backup server&lt;br /&gt;
REMOTE_HOST=&amp;quot;your_backup_server_ip&amp;quot; # IP address or hostname of your backup server&lt;br /&gt;
REMOTE_DIR=&amp;quot;/backups/server1/home/&amp;quot; # Directory on the remote server&lt;br /&gt;
&lt;br /&gt;
# --- Options ---&lt;br /&gt;
# -a: archive mode (preserves permissions, ownership, timestamps, etc.)&lt;br /&gt;
# -v: verbose (shows files being transferred)&lt;br /&gt;
# -z: compress file data during the transfer&lt;br /&gt;
# --delete: delete extraneous files from dest dirs (use with caution!)&lt;br /&gt;
# --exclude: patterns to exclude from backup&lt;br /&gt;
# --log-file: write output to a log file&lt;br /&gt;
RSYNC_OPTIONS=&amp;quot;-avz --delete --log-file=${LOG_FILE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# --- Pre-backup Checks ---&lt;br /&gt;
# Ensure source directory exists&lt;br /&gt;
if [ ! -d &amp;quot;$SOURCE_DIR&amp;quot; ]; then&lt;br /&gt;
    echo &amp;quot;[$DATE] ERROR: Source directory '$SOURCE_DIR' does not exist. Aborting.&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Ensure backup directory exists (for local testing or staging)&lt;br /&gt;
# For remote backups, this check is less critical as rsync will create it if needed on the remote side.&lt;br /&gt;
if [ ! -d &amp;quot;$BACKUP_DIR&amp;quot; ]; then&lt;br /&gt;
    echo &amp;quot;[$DATE] WARNING: Local backup staging directory '$BACKUP_DIR' does not exist. Creating it.&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
    mkdir -p &amp;quot;$BACKUP_DIR&amp;quot;&lt;br /&gt;
    if [ $? -ne 0 ]; then&lt;br /&gt;
        echo &amp;quot;[$DATE] ERROR: Failed to create local backup staging directory '$BACKUP_DIR'. Aborting.&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# --- Perform the Backup ---&lt;br /&gt;
echo &amp;quot;[$DATE] Starting backup of '$SOURCE_DIR' to remote '$REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR'&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
rsync $RSYNC_OPTIONS \&lt;br /&gt;
    --exclude='*.tmp' \&lt;br /&gt;
    --exclude='cache/' \&lt;br /&gt;
    &amp;quot;$SOURCE_DIR&amp;quot; &amp;quot;$REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# --- Post-backup Checks ---&lt;br /&gt;
RSYNC_EXIT_CODE=$?&lt;br /&gt;
&lt;br /&gt;
if [ $RSYNC_EXIT_CODE -eq 0 ]; then&lt;br /&gt;
    echo &amp;quot;[$DATE] Backup completed successfully.&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
    echo &amp;quot;[$DATE] ERROR: rsync exited with code $RSYNC_EXIT_CODE. Check log file for details.&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
    # Consider sending an email notification here for critical errors&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exit $RSYNC_EXIT_CODE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*   **`SOURCE_DIR`**: The directory you want to back up.&lt;br /&gt;
*   **`BACKUP_DIR`**: A local staging directory. While we're primarily focusing on remote backups, having a local staging area can be useful for testing or if your remote connection is temporarily unavailable.&lt;br /&gt;
*   **`LOG_FILE`**: Where `rsync` will write its output.&lt;br /&gt;
*   **`REMOTE_USER`**: The username on your backup server. This user must have SSH access and write permissions to the `REMOTE_DIR`.&lt;br /&gt;
*   **`REMOTE_HOST`**: The IP address or hostname of your backup server.&lt;br /&gt;
*   **`REMOTE_DIR`**: The target directory on your backup server.&lt;br /&gt;
*   **`RSYNC_OPTIONS`**:&lt;br /&gt;
    *   `-a` (archive): This is a crucial option that implies `-rlptgoD`. It recursively copies directories, preserves symbolic links, permissions, modification times, group, owner, and device files.&lt;br /&gt;
    *   `-v` (verbose): Provides detailed output of what `rsync` is doing. Helpful for debugging.&lt;br /&gt;
    *   `-z` (compress): Compresses file data during transfer. Saves bandwidth but uses more CPU.&lt;br /&gt;
    *   `--delete`: This option synchronizes the destination with the source. Any files in the destination that are no longer in the source will be deleted. **Use with extreme caution!** Ensure your `SOURCE_DIR` is correct before enabling this.&lt;br /&gt;
    *   `--exclude`: Allows you to skip specific files or directories. Useful for temporary files, caches, or large log files you don't need to back up.&lt;br /&gt;
*   **Pre-backup Checks**: These ensure the script doesn't proceed if essential directories are missing, preventing potential errors.&lt;br /&gt;
*   **Post-backup Checks**: The script checks the exit code of `rsync` to determine success or failure.&lt;br /&gt;
&lt;br /&gt;
=== Making the Script Executable ===&lt;br /&gt;
&lt;br /&gt;
Give your script execute permissions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo chmod +x /opt/scripts/backup_home.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing the Script ===&lt;br /&gt;
&lt;br /&gt;
Before automating, run the script manually to ensure it works as expected:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo /opt/scripts/backup_home.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the output and the log file (`/var/log/rsync_backup_home.log`) for any errors. Verify that files have been transferred to your `REMOTE_DIR` on the backup server.&lt;br /&gt;
&lt;br /&gt;
== Setting Up SSH Key-Based Authentication ==&lt;br /&gt;
&lt;br /&gt;
For `cron` to run `rsync` without prompting for a password, you need to set up SSH key-based authentication.&lt;br /&gt;
&lt;br /&gt;
=== Generate SSH Key Pair ===&lt;br /&gt;
&lt;br /&gt;
On your ''source'' server (the one you're backing up), generate an SSH key pair for the `root` user (or the user that will run the cron job):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su -&lt;br /&gt;
ssh-keygen -t rsa -b 4096&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Press Enter to accept the default file location (`/root/.ssh/id_rsa`) and leave the passphrase empty (press Enter twice). An empty passphrase is required for automated, non-interactive logins.&lt;br /&gt;
&lt;br /&gt;
=== Copy Public Key to Backup Server ===&lt;br /&gt;
&lt;br /&gt;
Now, copy the public key to your backup server. Replace `backupuser` and `your_backup_server_ip` with your actual details.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh-copy-id backupuser@your_backup_server_ip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be prompted for the `backupuser`'s password on the backup server. After this, you should be able to SSH from your source server to your backup server as `backupuser` without a password.&lt;br /&gt;
&lt;br /&gt;
=== Test SSH Connection ===&lt;br /&gt;
&lt;br /&gt;
Test the passwordless SSH connection:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh backupuser@your_backup_server_ip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You should log in directly without a password prompt. Type `exit` to return to your source server.&lt;br /&gt;
&lt;br /&gt;
== Automating Backups with Cron ==&lt;br /&gt;
&lt;br /&gt;
`cron` is a time-based job scheduler in Unix-like operating systems. We'll use it to run our `rsync` script automatically.&lt;br /&gt;
&lt;br /&gt;
=== Edit the Crontab ===&lt;br /&gt;
&lt;br /&gt;
Edit the crontab for the `root` user:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo crontab -e&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If prompted, choose an editor (e.g., `nano`).&lt;br /&gt;
&lt;br /&gt;
=== Add the Cron Job ===&lt;br /&gt;
&lt;br /&gt;
Add the following line to the end of the file to run the backup script daily at 2:00 AM:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0 2 * * * /opt/scripts/backup_home.sh &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let's break down the cron syntax:&lt;br /&gt;
&lt;br /&gt;
*   `0 2 * * *`: This specifies the schedule.&lt;br /&gt;
    *   `0`: Minute (0th minute of the hour)&lt;br /&gt;
    *   `2`: Hour (2 AM)&lt;br /&gt;
    *   `*`: Day of the month (every day)&lt;br /&gt;
    *   `*`: Month (every month)&lt;br /&gt;
    *   `*`: Day of the week (every day)&lt;br /&gt;
*   `/opt/scripts/backup_home.sh`: The command to execute (your backup script).&lt;br /&gt;
*   `&amp;gt; /dev/null 2&amp;gt;&amp;amp;1`: This redirects standard output and standard error to `/dev/null`. This prevents `cron` from emailing you the script's output every time it runs. The script itself logs to `/var/log/rsync_backup_home.log`.&lt;br /&gt;
&lt;br /&gt;
=== Save and Exit ===&lt;br /&gt;
&lt;br /&gt;
Save the crontab file and exit the editor. `cron` will automatically pick up the new job.&lt;br /&gt;
&lt;br /&gt;
== Advanced Considerations and Best Practices ==&lt;br /&gt;
&lt;br /&gt;
=== Incremental Backups with `--link-dest` ===&lt;br /&gt;
&lt;br /&gt;
For more efficient storage and faster backups, you can use `rsync`'s `--link-dest` option. This creates hard links to unchanged files from a previous backup, effectively making each backup a full snapshot while only storing new or modified data.&lt;br /&gt;
&lt;br /&gt;
Modify your script to include a `LATEST_BACKUP` variable pointing to the most recent backup directory and use `--link-dest`:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# ... (previous configuration) ...&lt;br /&gt;
&lt;br /&gt;
# --- New Configuration for Incremental Backups ---&lt;br /&gt;
INCREMENTAL_BASE=&amp;quot;/backups/server1/home/&amp;quot; # Base directory for all backups on remote server&lt;br /&gt;
LATEST_LINK=&amp;quot;${INCREMENTAL_BASE}latest&amp;quot; # A symbolic link to the most recent backup&lt;br /&gt;
CURRENT_BACKUP=&amp;quot;${INCREMENTAL_BASE}backup_$(date +&amp;quot;%Y-%m-%d_%H-%M-%S&amp;quot;)&amp;quot; # The new backup directory name&lt;br /&gt;
&lt;br /&gt;
# --- Options ---&lt;br /&gt;
# --link-dest: use this for incremental backups&lt;br /&gt;
RSYNC_OPTIONS=&amp;quot;-avz --delete --log-file=${LOG_FILE} --link-dest=${LATEST_LINK}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# --- Pre-backup Checks ---&lt;br /&gt;
# ... (same as before) ...&lt;br /&gt;
&lt;br /&gt;
# --- Perform the Backup ---&lt;br /&gt;
echo &amp;quot;[$DATE] Starting incremental backup of '$SOURCE_DIR' to remote '$REMOTE_USER@$REMOTE_HOST:$CURRENT_BACKUP'&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
&lt;br /&gt;
rsync $RSYNC_OPTIONS \&lt;br /&gt;
    --exclude='*.tmp' \&lt;br /&gt;
    --exclude='cache/' \&lt;br /&gt;
    &amp;quot;$SOURCE_DIR&amp;quot; &amp;quot;$REMOTE_USER@$REMOTE_HOST:$CURRENT_BACKUP&amp;quot;&lt;br /&gt;
&lt;br /&gt;
RSYNC_EXIT_CODE=$?&lt;br /&gt;
&lt;br /&gt;
if [ $RSYNC_EXIT_CODE -eq 0 ]; then&lt;br /&gt;
    echo &amp;quot;[$DATE] Backup completed successfully. Updating latest link.&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
    # Update the 'latest' symbolic link on the remote server&lt;br /&gt;
    ssh &amp;quot;$REMOTE_USER@$REMOTE_HOST&amp;quot; &amp;quot;rm -f ${INCREMENTAL_BASE}latest &amp;amp;&amp;amp; ln -s ${CURRENT_BACKUP} ${INCREMENTAL_BASE}latest&amp;quot;&lt;br /&gt;
    if [ $? -ne 0 ]; then&lt;br /&gt;
        echo &amp;quot;[$DATE] WARNING: Failed to update 'latest' symbolic link on remote server.&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
else&lt;br /&gt;
    echo &amp;quot;[$DATE] ERROR: rsync exited with code $RSYNC_EXIT_CODE. Check log file for details.&amp;quot; | tee -a &amp;quot;$LOG_FILE&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exit $RSYNC_EXIT_CODE&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
*   **`INCREMENTAL_BASE`**: The root directory on the backup server where all dated backup directories will reside.&lt;br /&gt;
*   **`LATEST_LINK`**: A symbolic link that always points to the most recent successful backup. `rsync` uses this to find unchanged files.&lt;br /&gt;
*   **`CURRENT_BACKUP`**: The name of the new directory for the current backup.&lt;br /&gt;
*   **`--link-dest=${LATEST_LINK}`**: This tells `rsync` to look at the directory pointed to by `LATEST_LINK` for unchanged files. If a file hasn't changed, it creates a hard link to it in the `CURRENT_BACKUP` directory instead of copying it again.&lt;br /&gt;
*   **Updating `latest` symlink**: After a successful backup, we use `ssh` to remotely update the `latest` symbolic link to point to the newly created backup directory. This is critical for the next incremental backup.&lt;br /&gt;
&lt;br /&gt;
=== Backup Rotation and Pruning ===&lt;br /&gt;
&lt;br /&gt;
Incremental backups can consume significant disk space over time. Implement a strategy to remove old backups. You can do this with a separate script that runs after your `rsync` job, or as part of the `rsync` script itself.&lt;br /&gt;
&lt;br /&gt;
Example script to remove backups older than 30 days (run this *after* your main backup script):&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
BACKUP_ROOT=&amp;quot;/backups/server1/home/&amp;quot; # Base directory on the remote server&lt;br /&gt;
DAYS_TO_KEEP=30&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Pruning backups older than $DAYS_TO_KEEP days in $BACKUP_ROOT...&amp;quot;&lt;br /&gt;
ssh backupuser@your_backup_server_ip &amp;quot;find ${BACKUP_ROOT} -maxdepth 1 -type d -name 'backup_*' -mtime +${DAYS_TO_KEEP} -exec echo 'Deleting old backup: {}' \; -exec rm -rf {} \;&amp;quot;&lt;br /&gt;
echo &amp;quot;Pruning complete.&amp;quot;&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Add this script to your `crontab` to run after the main backup job.&lt;br /&gt;
&lt;br /&gt;
=== Encrypting Backups ===&lt;br /&gt;
&lt;br /&gt;
For sensitive data, consider encrypting your backups. Tools like `gpg` can be used. You would typically encrypt the data *before* sending it to the backup server, or encrypt the backup archive.&lt;br /&gt;
&lt;br /&gt;
=== Monitoring and Alerting ===&lt;br /&gt;
&lt;br /&gt;
*   **Log Rotation**: Use `logrotate` to manage your `rsync` log files to prevent them from growing indefinitely.&lt;br /&gt;
*   **Email Notifications**: Enhance your script to send email alerts on backup failures. You can use the `mail` command for this.&lt;br /&gt;
*   **Disk Space Monitoring**: Regularly monitor the disk space on your backup server.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting Common Issues ==&lt;br /&gt;
&lt;br /&gt;
*   **''Permission Denied'' when running script**:&lt;br /&gt;
    *   Ensure the script has execute permissions (`chmod +x`).&lt;br /&gt;
    *   Verify the user running the script (e.g., `root` via `sudo crontab -e`) has read access to source directories and write access to log/backup directories.&lt;br /&gt;
*   **''Password prompt'' during `rsync` execution**:&lt;br /&gt;
    *   SSH key-based authentication is not set up correctly. Revisit the &amp;quot;Setting Up SSH Key-Based Authentication&amp;quot; section.&lt;br /&gt;
    *   Ensure the `ssh-copy-id` command was used successfully and test the passwordless SSH connection manually.&lt;br /&gt;
    *   Check permissions on `~/.ssh/` and `~/.ssh/authorized_keys` on the backup server. They should be `700` and `600` respectively for the user running the backup.&lt;br /&gt;
*   **''rsync: command not found''**:&lt;br /&gt;
    *   Ensure `rsync` is installed on your server: `sudo apt update &amp;amp;&amp;amp; sudo apt install rsync` (Debian/Ubuntu) or `sudo yum install rsync` (CentOS/RHEL).&lt;br /&gt;
*   **''rsync exited with code 23'' (Partial transfer due to vanished source files)**:&lt;br /&gt;
    *   This usually means some files were deleted or moved on the source *during* the `rsync` process. This is generally not a critical error if the backup is otherwise complete, but it indicates that the source data changed mid-backup.&lt;br /&gt;
*   **''rsync exited with code 24'' (Partial transfer due to vanished destination files)**:&lt;br /&gt;
    *   This is more serious. It can indicate issues with the destination filesystem or permissions.&lt;br /&gt;
*   **''rsync exited with code 126'' (Command invoked cannot execute)**:&lt;br /&gt;
    *   The script file does not have execute permissions.&lt;br /&gt;
*   **''rsync exited with code&lt;br /&gt;
&lt;br /&gt;
[[Category:Backup]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>