{"id":9008,"date":"2024-07-29T11:43:17","date_gmt":"2024-07-29T11:43:17","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=9008"},"modified":"2024-07-29T11:44:02","modified_gmt":"2024-07-29T11:44:02","slug":"automating-server-backups-rsync-cron-centos","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/","title":{"rendered":"Automating Server Backups with rsync and cron on CentOS"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/07\/backup_rsync_centos_en.jpg\" alt=\"Automating Server Backups rsync and cron CentOS \" class=\"wp-image-9031\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/07\/backup_rsync_centos_en.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/07\/backup_rsync_centos_en-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/07\/backup_rsync_centos_en-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/07\/backup_rsync_centos_en-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/07\/backup_rsync_centos_en-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"introduction\">Introduction<\/h2>\n\n\n\n<p>In the digital age, data is the lifeblood of any organization. Losing critical data can be devastating, making data backups essential. Automating <strong>server backups with rsync and cron<\/strong> on CentOS ensures that your data is consistently backed up without manual intervention. This guide delves into the intricacies of using rsync and cron, two powerful tools that simplify the backup process and offer robust solutions for data integrity and security.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"understanding-rsync-and-cron\"><strong>Understanding rsync and cron<\/strong><\/h2>\n\n\n\n<p><strong>What is rsync?<\/strong>&nbsp;Rsync is a versatile command-line utility for synchronizing files and directories between two locations over a remote shell, offering efficient and incremental file transfer. Its ability to copy only the changes between source and destination makes it faster than traditional copy methods.<\/p>\n\n\n\n<p><strong>What is cron?<\/strong>&nbsp;Cron is a time-based job scheduler in Unix-like operating systems. It allows users to schedule scripts or commands to run at specified times and intervals, making it ideal for automating repetitive tasks like backups.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-automate-server-backups\"><strong>Why Automate Server Backups?<\/strong><\/h2>\n\n\n\n<p>Automating server backups mitigates the risk of human error, ensures timely backups, and frees up valuable administrative time. By leveraging rsync and cron, you can create a robust backup system that runs seamlessly in the background, safeguarding your data with minimal oversight.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"setting-up-the-environment\"><strong>Setting Up the Environment<\/strong><\/h2>\n\n\n\n<p><strong>Preparing CentOS for Automation<\/strong>&nbsp;Before diving into the automation process, ensure your CentOS environment is up-to-date. Run the following commands to update your system:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo yum update -y<\/code><\/pre>\n\n\n\n<p><strong>Installing rsync and cron<\/strong>&nbsp;Typically, rsync and cron are pre-installed on CentOS. However, you can verify their installation and install them if necessary:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo yum install rsync -y\n$ sudo yum install cronie -y<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configuring-rsync-for-backups\"><strong>Configuring rsync for Backups<\/strong><\/h2>\n\n\n\n<p><strong>Basic rsync Command Syntax<\/strong>&nbsp;Understanding the basic syntax of rsync is crucial for configuring backups. The general format is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ rsync [options] source destination<\/code><\/pre>\n\n\n\n<p><strong>Common rsync Options<\/strong><\/p>\n\n\n\n<ul>\n<li><code>-a<\/code>: Archive mode, preserves permissions, timestamps, and symlinks.<\/li>\n\n\n\n<li><code>-v<\/code>: Verbose, provides detailed output.<\/li>\n\n\n\n<li><code>-z<\/code>: Compresses files during transfer.<\/li>\n\n\n\n<li><code>--delete<\/code>: Deletes files in the destination that are no longer in the source.<\/li>\n<\/ul>\n\n\n\n<p><strong>Example rsync Command<\/strong>&nbsp;To synchronize the&nbsp;<code>\/home\/user\/data<\/code>&nbsp;directory to a remote server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ rsync -avz \/home\/user\/data\/ user@remote_server:\/backup\/data\/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"setting-up-password-less-ssh-authentication\"><strong>Setting Up Password-less SSH Authentication<\/strong><\/h2>\n\n\n\n<p><strong>Generating SSH Keys<\/strong>&nbsp;To enable automated backups, set up password-less SSH authentication between your CentOS server and the remote backup server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ ssh-keygen -t rsa<\/code><\/pre>\n\n\n\n<p><strong>Copying SSH Key to Remote Server<\/strong>&nbsp;Use the&nbsp;<code>ssh-copy-id<\/code>&nbsp;command to copy your public key to the remote server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ ssh-copy-id user@remote_server<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"creating-a-backup-script\"><strong>Creating a Backup Script<\/strong><\/h2>\n\n\n\n<p><strong>Writing the Backup Script<\/strong>&nbsp;Create a shell script to handle the backup process. This script will use rsync to synchronize directories. Here&#8217;s a sample script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">#!\/bin\/bash\n\n<em># Define variables<\/em>\nSOURCE_DIR=\"\/home\/user\/data\/\"\nDEST_USER=\"user\"\nDEST_SERVER=\"remote_server\"\nDEST_DIR=\"\/backup\/data\/\"\n\n<em># Run rsync command<\/em>\nrsync -avz --delete $SOURCE_DIR $DEST_USER@$DEST_SERVER:$DEST_DIR<\/code><\/pre>\n\n\n\n<p><strong>Making the Script Executable<\/strong>&nbsp;Ensure the script has executable permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ chmod +x \/path\/to\/backup_script.sh<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"automating-the-script-with-cron\"><strong>Automating the Script with cron<\/strong><\/h2>\n\n\n\n<p><strong>Understanding Cron Job Syntax<\/strong>&nbsp;Cron jobs follow a specific syntax to schedule tasks:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">* * * * * \/path\/to\/command<\/code><\/pre>\n\n\n\n<p>The five asterisks represent the minute, hour, day of the month, month, and day of the week.<\/p>\n\n\n\n<p><strong>Creating a Cron Job<\/strong>&nbsp;Edit the cron table to add your backup script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ crontab -e<\/code><\/pre>\n\n\n\n<p>Add the following line to schedule the backup script to run daily at 2 AM:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">0 2 * * * \/path\/to\/backup_script.sh<\/code><\/pre>\n\n\n\n<p><strong>Verifying the Cron Job<\/strong>&nbsp;List your cron jobs to verify the entry:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ crontab -l<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"monitoring-and-managing-backups\"><strong>Monitoring and Managing Backups<\/strong><\/h2>\n\n\n\n<p><strong>Logging Backup Activity<\/strong>&nbsp;Modify your backup script to log its activity:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">#!\/bin\/bash\n\n<em># Define variables<\/em>\nSOURCE_DIR=\"\/home\/user\/data\/\"\nDEST_USER=\"user\"\nDEST_SERVER=\"remote_server\"\nDEST_DIR=\"\/backup\/data\/\"\nLOG_FILE=\"\/var\/log\/backup.log\"\n\n<em># Run rsync command and log output<\/em>\nrsync -avz --delete $SOURCE_DIR $DEST_USER@$DEST_SERVER:$DEST_DIR &gt;&gt; $LOG_FILE 2&gt;&amp;1<\/code><\/pre>\n\n\n\n<p><strong>Checking Backup Logs<\/strong>&nbsp;Regularly check the log file to ensure backups are running smoothly:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ tail -f \/var\/log\/backup.log<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"enhancing-backup-security\"><strong>Enhancing Backup Security<\/strong><\/h2>\n\n\n\n<p><strong>Encrypting Data Transfers<\/strong>&nbsp;Ensure data security during transfer by using SSH with rsync:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ rsync -avz -e ssh \/home\/user\/data\/ user@remote_server:\/backup\/data\/<\/code><\/pre>\n\n\n\n<p><strong>Securing SSH Keys<\/strong>&nbsp;Limit SSH key access to the backup script by setting appropriate file permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ chmod 600 \/home\/user\/.ssh\/id_rsa<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"handling-common-issues\"><strong>Handling Common Issues<\/strong><\/h2>\n\n\n\n<p><strong>Troubleshooting Failed Backups<\/strong>&nbsp;Check for common issues such as network connectivity problems, incorrect paths, or permission errors. Use the&nbsp;<code>-v<\/code>&nbsp;option in rsync for detailed output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ rsync -avz \/home\/user\/data\/ user@remote_server:\/backup\/data\/<\/code><\/pre>\n\n\n\n<p><strong>Ensuring Sufficient Disk Space<\/strong>&nbsp;Monitor disk space on both the source and destination servers to avoid backup failures due to insufficient space:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ df -h<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"advanced-rsync-features\"><strong>Advanced rsync Features<\/strong><\/h2>\n\n\n\n<p><strong>Incremental Backups<\/strong>&nbsp;Leverage rsync\u2019s incremental backup capability by using the&nbsp;<code>--link-dest<\/code>&nbsp;option to create hard links to unchanged files, saving space:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ rsync -avz --delete --link-dest=\/backup\/previous \/home\/user\/data\/ user@remote_server:\/backup\/current<\/code><\/pre>\n\n\n\n<p><strong>Bandwidth Limitation<\/strong>&nbsp;Limit the bandwidth used by rsync during transfers with the&nbsp;<code>--bwlimit<\/code>&nbsp;option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ rsync -avz --bwlimit=1000 \/home\/user\/data\/ user@remote_server:\/backup\/data\/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using-rsync-with-systemd-timers\"><strong>Using rsync with Systemd Timers<\/strong><\/h2>\n\n\n\n<p><strong>Setting Up Systemd Timers<\/strong>&nbsp;Instead of cron, you can use systemd timers for more flexibility and reliability. Create a systemd service file for your backup script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">[Unit]\nDescription=Backup Service\n\n[Service]\nExecStart=\/path\/to\/backup_script.sh<\/code><\/pre>\n\n\n\n<p><strong>Creating a Timer Unit<\/strong>&nbsp;Next, create a timer unit to schedule the service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">[Unit]\nDescription=Run Backup Script Daily\n\n[Timer]\nOnCalendar=daily\n\n[Install]\nWantedBy=timers.target<\/code><\/pre>\n\n\n\n<p>Enable and start the timer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo systemctl enable backup_script.timer\n$ sudo systemctl start backup_script.timer<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ensuring-backup-integrity\"><strong>Ensuring Backup Integrity<\/strong><\/h2>\n\n\n\n<p><strong>Verifying Backup Completeness<\/strong>&nbsp;Regularly verify the integrity and completeness of your backups. Use the&nbsp;<code>--checksum<\/code>&nbsp;option with rsync to compare file checksums:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ rsync -avz --checksum \/home\/user\/data\/ user@remote_server:\/backup\/data\/<\/code><\/pre>\n\n\n\n<p><strong>Testing Backup Restoration<\/strong>&nbsp;Periodically test the restoration process to ensure you can successfully recover data in case of an emergency. Use rsync to restore files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ rsync -avz user@remote_server:\/backup\/data\/ \/home\/user\/restore\/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"scaling-backup-solutions\"><strong>Scaling Backup Solutions<\/strong><\/h2>\n\n\n\n<p><strong>Backing Up Multiple Directories<\/strong>&nbsp;Modify your backup script to include multiple source directories:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">#!\/bin\/bash\n\n<em># Define variables<\/em>\nSOURCE_DIRS=(\"\/home\/user\/data1\/\" \"\/home\/user\/data2\/\")\nDEST_USER=\"user\"\nDEST_SERVER=\"remote_server\"\nDEST_DIR=\"\/backup\/\"\n\n<em># Loop through directories and run rsync<\/em>\nfor DIR in \"${SOURCE_DIRS[@]}\"; do\n  rsync -avz --delete $DIR $DEST_USER@$DEST_SERVER:$DEST_DIR$(basename $DIR)\/\ndone<\/code><\/pre>\n\n\n\n<p><strong>Using rsync Daemon<\/strong>&nbsp;For large-scale environments, consider setting up an rsync daemon for efficient, secure, and manageable backups. Configure&nbsp;<code>\/etc\/rsyncd.conf<\/code>&nbsp;on the remote server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">uid = nobody\ngid = nobody\nuse chroot = yes\nmax connections = 4\nlog file = \/var\/log\/rsyncd.log\n[backup]\n  path = \/backup\n  comment = Backup Directory\n  read only = no\n  list = yes\n  auth users = backupuser\n  secrets file = \/etc\/rsyncd.secrets<\/code><\/pre>\n\n\n\n<p>Create the secrets file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">backupuser:password<\/code><\/pre>\n\n\n\n<p>Ensure it has the correct permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ chmod 600 \/etc\/rsyncd.secrets<\/code><\/pre>\n\n\n\n<p>Start the rsync daemon:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo systemctl start rsyncd\n$ sudo systemctl enable rsyncd<\/code><\/pre>\n\n\n\n<p>Use the following rsync command to connect to the daemon:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ rsync -avz \/home\/user\/data\/ backupuser@remote_server::backup<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"backup-strategies-and-best-practices\"><strong>Backup Strategies and Best Practices<\/strong><\/h2>\n\n\n\n<p><strong>Choosing Backup Frequencies<\/strong>&nbsp;Determine the appropriate backup frequency based on the nature of your data and business requirements. Daily, weekly, and monthly backups are common practices.<\/p>\n\n\n\n<p><strong>Implementing Retention Policies<\/strong>&nbsp;Maintain a balance between storage usage and backup history by implementing retention policies. For instance, keep daily backups for one week, weekly backups for one month, and monthly backups for one year.<\/p>\n\n\n\n<p><strong>Offsite Backups<\/strong>&nbsp;Ensure data redundancy by storing backups at an offsite location. This practice protects against local disasters like fire or theft.<\/p>\n\n\n\n<p><strong>Regular Backup Audits<\/strong>&nbsp;Conduct regular audits to ensure your backup processes are functioning correctly and that data can be restored successfully.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faqs\"><strong>FAQs<\/strong><\/h2>\n\n\n\n<p><strong>How can I ensure my backups are secure?<\/strong>&nbsp;Use SSH for secure data transfer, set appropriate permissions on backup files, and regularly update your system to protect against vulnerabilities.<\/p>\n\n\n\n<p><strong>Can I use rsync for both local and remote backups?<\/strong>&nbsp;Yes, rsync works for both local and remote backups. Simply adjust the source and destination paths accordingly.<\/p>\n\n\n\n<p><strong>What happens if my backup fails?<\/strong>&nbsp;Regularly monitor logs to identify and address issues promptly. Ensure you have sufficient disk space and network connectivity.<\/p>\n\n\n\n<p><strong>How do I schedule multiple backups with cron?<\/strong>&nbsp;Add multiple cron job entries for different backup scripts or directories, specifying unique schedules for each.<\/p>\n\n\n\n<p><strong>Is it possible to compress backups to save space?<\/strong>&nbsp;Yes, rsync supports compression during transfer with the&nbsp;<code>-z<\/code>&nbsp;option, and you can also compress files after transfer using tools like gzip or tar.<\/p>\n\n\n\n<p><strong>What are the alternatives to rsync and cron for backups?<\/strong>&nbsp;Consider tools like Bacula, Amanda, or Duplicity for more complex backup needs, or cloud-based solutions like AWS S3 or Google Cloud Storage for offsite backups.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Automating server backups with rsync and cron on CentOS provides a reliable, efficient, and scalable solution for safeguarding your data. By following the steps outlined in this guide, you can ensure your data is consistently and securely backed up, minimizing the risk of data loss. Regular monitoring, testing, and adhering to best practices will further enhance the reliability of your backup system, giving you peace of mind in the event of data emergencies.<\/p>\n\n\n\n<p><strong>For More Info:<\/strong><\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/rsync.samba.org\/documentation.html\" target=\"_blank\" rel=\"noreferrer noopener\">Official rsync Documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.webhi.com\/how-to\/use-cron-to-automate-tasks-on-ubuntu-lts-centos\/\" target=\"_blank\" rel=\"noreferrer noopener\">Cron Job Basics<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.ssh.com\/academy\/ssh\/keygen\" target=\"_blank\" rel=\"noreferrer noopener\">SSH Key Authentication<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.timer.html\" target=\"_blank\" rel=\"noreferrer noopener\">Systemd Timers<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.linux.com\/training-tutorials\/understanding-linux-file-permissions\/\" target=\"_blank\" rel=\"noreferrer noopener\">Linux File Permissions<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In the digital age, data is the lifeblood of any organization. Losing critical data can be devastating, making data backups essential. Automating server backups with rsync and cron on CentOS ensures that your data is consistently backed up without manual intervention. This guide delves into the intricacies of using rsync and cron, two powerful ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[69,3],"tags":[],"yoast_head":"\n<title>Automating Server Backups with rsync and cron on CentOS - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"Learn the ultimate guide to automating server backups with rsync and cron on CentOS. Ensure your data&#039;s safety with this comprehensive tutorial.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automating Server Backups with rsync and cron on CentOS - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"Learn the ultimate guide to automating server backups with rsync and cron on CentOS. Ensure your data&#039;s safety with this comprehensive tutorial.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-29T11:43:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-29T11:44:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/07\/backup_rsync_centos_en.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"Automating Server Backups with rsync and cron on CentOS\",\"datePublished\":\"2024-07-29T11:43:17+00:00\",\"dateModified\":\"2024-07-29T11:44:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/\"},\"wordCount\":1217,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"Linux system administration\",\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/\",\"name\":\"Automating Server Backups with rsync and cron on CentOS - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2024-07-29T11:43:17+00:00\",\"dateModified\":\"2024-07-29T11:44:02+00:00\",\"description\":\"Learn the ultimate guide to automating server backups with rsync and cron on CentOS. Ensure your data's safety with this comprehensive tutorial.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating Server Backups with rsync and cron on CentOS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"Automating Server Backups with rsync and cron on CentOS - WebHi Tutorials &amp; Documentations","description":"Learn the ultimate guide to automating server backups with rsync and cron on CentOS. Ensure your data's safety with this comprehensive tutorial.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/","og_locale":"en_US","og_type":"article","og_title":"Automating Server Backups with rsync and cron on CentOS - WebHi Tutorials &amp; Documentations","og_description":"Learn the ultimate guide to automating server backups with rsync and cron on CentOS. Ensure your data's safety with this comprehensive tutorial.","og_url":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2024-07-29T11:43:17+00:00","article_modified_time":"2024-07-29T11:44:02+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2024\/07\/backup_rsync_centos_en.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"Automating Server Backups with rsync and cron on CentOS","datePublished":"2024-07-29T11:43:17+00:00","dateModified":"2024-07-29T11:44:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/"},"wordCount":1217,"commentCount":0,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["Linux system administration","Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/","url":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/","name":"Automating Server Backups with rsync and cron on CentOS - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2024-07-29T11:43:17+00:00","dateModified":"2024-07-29T11:44:02+00:00","description":"Learn the ultimate guide to automating server backups with rsync and cron on CentOS. Ensure your data's safety with this comprehensive tutorial.","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/automating-server-backups-rsync-cron-centos\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"Automating Server Backups with rsync and cron on CentOS"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1784239260","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/9008"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=9008"}],"version-history":[{"count":8,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/9008\/revisions"}],"predecessor-version":[{"id":9053,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/9008\/revisions\/9053"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=9008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=9008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=9008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}