{"id":2044,"date":"2024-10-29T21:11:32","date_gmt":"2024-10-29T15:41:32","guid":{"rendered":"https:\/\/maheshpalamuttath.info\/?p=2044"},"modified":"2024-10-29T21:35:40","modified_gmt":"2024-10-29T16:05:40","slug":"automating-wordpress-backups-with-a-shell-script","status":"publish","type":"post","link":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/","title":{"rendered":"Automating WordPress Backups with a Shell Script"},"content":{"rendered":"<p>In the digital age, data is invaluable, especially for websites that rely on content management systems like WordPress. Regular backups are essential to safeguard your website against data loss due to various reasons, including server failures, malware attacks, or accidental deletions. In this post, we&#8217;ll walk through a shell script designed to automate the backup process for a WordPress site, ensuring you have secure copies of your database and files.<\/p>\n<p><strong>Why Backup Your WordPress Site?<\/strong><\/p>\n<p>Backups serve as your safety net. They allow you to quickly restore your site to a previous state in case of issues. Here are some key reasons to regularly back up your WordPress site:<\/p>\n<ul>\n<li>Data Loss Prevention: Accidental changes or deletions can happen. A backup allows you to revert to a working version.<\/li>\n<li>Malware Recovery: If your site gets compromised, having a clean backup is crucial for recovery.<\/li>\n<li>Server Failures: Hardware or software failures can lead to data loss. Backups ensure you can restore your site.<\/li>\n<\/ul>\n<p><strong>The Backup Script<\/strong><\/p>\n<p>Here\u2019s a breakdown of a simple yet effective backup script for a WordPress site:<\/p>\n<p><code>#!\/bin\/bash<\/code><\/p>\n<p><code># 1: Define backup filenames with timestamps.<\/code><br \/>\n<code>db_backup_name=\"wp-db-backup-$(date +%d-%m-%Y-%H.%M).sql.gz\"<\/code><br \/>\n<code>wpfiles_backup_name=\"wp-content-backup-$(date +%d-%m-%Y-%H.%M).tar.gz\"<\/code><\/p>\n<p><code># 2: Database connection info.<\/code><br \/>\n<code>db_name=\"wordpress\"<\/code><br \/>\n<code>db_username=\"wordpress\"<\/code><br \/>\n<code>db_password=\"wordpress123\"<\/code><\/p>\n<p><code># 3: Path to WordPress root directory and wp-content.<\/code><br \/>\n<code>wp_root_folder=\"\/var\/www\/html\/wordpress\"<\/code><br \/>\n<code>backup_folder_path=\"\/home\/mahesh\/backups\/wordpress\"<\/code><\/p>\n<p><code># 4: Backup MySQL database.<\/code><br \/>\n<code>mysqldump --opt -u\"$db_username\" -p\"$db_password\" \"$db_name\" | gzip &gt; \"$backup_folder_path\/$db_backup_name\"<\/code><\/p>\n<p><code># 5: Navigate to WordPress root and create a tarball of wp-content only.<\/code><br \/>\n<code>cd \"$wp_root_folder\" || exit<\/code><br \/>\n<code>tar -czf \"$backup_folder_path\/$wpfiles_backup_name\" wp-content<\/code><\/p>\n<p><code># 6: Delete all but 3 most recent database backups.<\/code><br \/>\n<code>find \"$backup_folder_path\" -maxdepth 1 -name \"*.sql.gz\" -type f -printf \"%T@ %p\\n\" | sort -rn | awk 'NR&gt;3 {print $2}' | xargs -r rm --<\/code><\/p>\n<p><code># 7: Delete all but 3 most recent wp-content backups.<\/code><br \/>\n<code>find \"$backup_folder_path\" -maxdepth 1 -name \"*.tar.gz\" -type f -printf \"%T@ %p\\n\" | sort -rn | awk 'NR&gt;3 {print $2}' | xargs -r rm --<\/code><\/p>\n<p>Download the Script: <a href=\"https:\/\/gist.githubusercontent.com\/maheshpalamuttath\/482f1e43bc170d822fc4b19f368cd655\/raw\/8e2e96e40b2159aece20b6a0143f9383723b8317\/wp-backup.sh\">gist.githubusercontent.com\/maheshpalamuttath\/482f1e43bc170d822fc4b19f368cd655\/raw\/8e2e96e40b2159aece20b6a0143f9383723b8317\/wp-backup.sh<\/a><\/p>\n<p><strong>Breakdown of the Script<\/strong><\/p>\n<p>1. Defining Backup Filenames<br \/>\nThe script starts by defining the names for the backups with a timestamp, ensuring that each backup is uniquely named. This prevents any accidental overwriting of existing backups.<\/p>\n<p><code>db_backup_name=\"wp-db-backup-$(date +%d-%m-%Y-%H.%M).sql.gz\"<\/code><br \/>\n<code>wpfiles_backup_name=\"wp-content-backup-$(date +%d-%m-%Y-%H.%M).tar.gz\"<\/code><\/p>\n<p>2. Database Connection Information<br \/>\nNext, the script defines the database connection information, including the database name, username, and password. This allows the script to connect to the MySQL database to create a backup.<\/p>\n<p><code>db_name=\"wordpress\"<\/code><br \/>\n<code>db_username=\"wordpress\"<\/code><br \/>\n<code>db_password=\"wordpress123\"<\/code><\/p>\n<p>Security Note: It is advisable to avoid hardcoding sensitive information directly into scripts. Consider using environment variables or a configuration file that has restricted access.<\/p>\n<p>3. Specifying Directories<br \/>\nThe paths to the WordPress root directory and the backup location are specified. This ensures that the script knows where to look for the files to back up and where to store the backup files.<\/p>\n<p><code>wp_root_folder=\"\/var\/www\/html\/wordpress\"<\/code><br \/>\n<code>backup_folder_path=\"\/home\/sasc\/backups\/mahesh\/wordpress\"<\/code><\/p>\n<p>4. Backing Up the MySQL Database<br \/>\nThe mysqldump command creates a backup of the WordPress database, compressing it with gzip to save space. The output is redirected to a file named based on the current timestamp.<\/p>\n<p><code>mysqldump --opt -u\"$db_username\" -p\"$db_password\" \"$db_name\" | gzip &gt; \"$backup_folder_path\/$db_backup_name\"<\/code><\/p>\n<p>5. Creating a Tarball of wp-content<br \/>\nThe script changes the directory to the WordPress root and creates a tarball of the wp-content directory, which contains all your themes, plugins, and uploaded files.<\/p>\n<p><code>cd \"$wp_root_folder\" || exit<\/code><br \/>\n<code>tar -czf \"$backup_folder_path\/$wpfiles_backup_name\" wp-content<\/code><\/p>\n<p>6. Cleaning Up Old Backups<br \/>\nTo manage disk space, the script includes commands to delete old backups, keeping only the three most recent database backups and wp-content backups.<\/p>\n<p><code>find \"$backup_folder_path\" -maxdepth 1 -name \"*.sql.gz\" -type f -printf \"%T@ %p\\n\" | sort -rn | awk 'NR&gt;3 {print $2}' | xargs -r rm --<\/code><br \/>\n<code>find \"$backup_folder_path\" -maxdepth 1 -name \"*.tar.gz\" -type f -printf \"%T@ %p\\n\" | sort -rn | awk 'NR&gt;3 {print $2}' | xargs -r rm --<\/code><\/p>\n<p>To set up this backup script on your server to run at regular intervals, you can use cron, the default job scheduler on Linux. Here&#8217;s a step-by-step guide:<\/p>\n<p>Save your backup script with a .sh extension in a location that you can access. For example:<\/p>\n<p><code>sudo su<\/code><br \/>\n<code>vim \/usr\/local\/bin\/wp_backup.sh<\/code><\/p>\n<p>Copy the script into this file, save it, and exit.<\/p>\n<p>Give the script execute permissions so it can run:<\/p>\n<p><code>chmod +x \/usr\/local\/bin\/wp_backup.sh<\/code><\/p>\n<p>Run the script manually to ensure it works as expected:<\/p>\n<p><code>\/usr\/local\/bin\/wp_backup.sh<\/code><\/p>\n<p>If there are any errors, they should show up now, and you can troubleshoot as needed.<\/p>\n<p>Use cron to automate the backup process. To edit the cron jobs:<\/p>\n<p><code>crontab -e<\/code><\/p>\n<p>Add a new line at the end of the file to specify when you\u2019d like the backup to run. For example, to run the backup script every day at 2:00 AM, add this line:<\/p>\n<p><code>0 2 * * * \/usr\/local\/bin\/wp_backup.sh &gt;&gt; \/home\/sasc\/logs\/wp_backup.log 2&gt;&amp;1<\/code><\/p>\n<p>This command means:<\/p>\n<p><code>0 2 * * * - Run at 2:00 AM every day.<\/code><br \/>\n<code>\/usr\/local\/bin\/wp_backup.sh <\/code>&#8211; Path to your backup script.<br \/>\n<code>&gt;&gt; \/usr\/local\/bin\/logs\/wp_backup.log 2&gt;&amp;1\u00a0<\/code> &#8211; Save output and errors to a log file for troubleshooting.<\/p>\n<p>If you&#8217;re using a log file, create a directory for it (Optional):<\/p>\n<p><code>mkdir -p \/usr\/local\/bin\/logs<\/code><\/p>\n<p>After adding the cron job, you can verify it with:<\/p>\n<p><code>crontab -l<\/code><\/p>\n<p>Your backup script is now set to run automatically on your server specified interval!<\/p>\n<p>Use Rclone for Synching backup files into Google Drive: <a href=\"https:\/\/libtechnophile.blogspot.com\/2020\/07\/using-google-drive-on-debianubuntu-with.html\" target=\"_blank\" rel=\"noopener\">https:\/\/libtechnophile.blogspot.com\/2020\/07\/using-google-drive-on-debianubuntu-with.html<\/a><\/p>\n<p>Automating your WordPress backups with a shell script is a practical solution to ensure your data is safe and easily restorable. By regularly running this script, you can avoid the headaches of data loss and keep your site secure. Remember to periodically check your backup files and test the restoration process to ensure everything works as expected.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the digital age, data is invaluable, especially for websites that rely on content management systems like WordPress. Regular backups are essential to safeguard your website against data loss due to various reasons, including server failures, malware attacks, or accidental deletions. In this post, we&#8217;ll walk through a shell script designed to automate the backup &hellip; <a href=\"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Automating WordPress Backups with a Shell Script&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2059,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[59],"tags":[60],"class_list":["post-2044","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-backup"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Automating WordPress Backups with a Shell Script | MAHESH PALAMUTTATH<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automating WordPress Backups with a Shell Script | MAHESH PALAMUTTATH\" \/>\n<meta property=\"og:description\" content=\"In the digital age, data is invaluable, especially for websites that rely on content management systems like WordPress. Regular backups are essential to safeguard your website against data loss due to various reasons, including server failures, malware attacks, or accidental deletions. In this post, we&#8217;ll walk through a shell script designed to automate the backup &hellip; Continue reading &quot;Automating WordPress Backups with a Shell Script&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/\" \/>\n<meta property=\"og:site_name\" content=\"MAHESH PALAMUTTATH\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-29T15:41:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-29T16:05:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/maheshpalamuttath.info\/wp-content\/uploads\/2024\/10\/new_wp-1-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mahesh Palamuttath\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mahesh Palamuttath\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/\"},\"author\":{\"name\":\"Mahesh Palamuttath\",\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/#\\\/schema\\\/person\\\/43e1a3239c44ffb33cfa718d11a76226\"},\"headline\":\"Automating WordPress Backups with a Shell Script\",\"datePublished\":\"2024-10-29T15:41:32+00:00\",\"dateModified\":\"2024-10-29T16:05:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/\"},\"wordCount\":703,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/maheshpalamuttath.info\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/new_wp-1-1.png?fit=1000%2C420&ssl=1\",\"keywords\":[\"Backup\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/\",\"url\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/\",\"name\":\"Automating WordPress Backups with a Shell Script | MAHESH PALAMUTTATH\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/maheshpalamuttath.info\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/new_wp-1-1.png?fit=1000%2C420&ssl=1\",\"datePublished\":\"2024-10-29T15:41:32+00:00\",\"dateModified\":\"2024-10-29T16:05:40+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/#\\\/schema\\\/person\\\/43e1a3239c44ffb33cfa718d11a76226\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/maheshpalamuttath.info\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/new_wp-1-1.png?fit=1000%2C420&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/maheshpalamuttath.info\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/new_wp-1-1.png?fit=1000%2C420&ssl=1\",\"width\":1000,\"height\":420},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/2024\\\/10\\\/29\\\/automating-wordpress-backups-with-a-shell-script\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/maheshpalamuttath.info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating WordPress Backups with a Shell Script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/#website\",\"url\":\"https:\\\/\\\/maheshpalamuttath.info\\\/\",\"name\":\"MAHESH PALAMUTTATH\",\"description\":\"LINUX, FOSS &amp;  LIBRARY TECHNOLOGIST\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/maheshpalamuttath.info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/maheshpalamuttath.info\\\/#\\\/schema\\\/person\\\/43e1a3239c44ffb33cfa718d11a76226\",\"name\":\"Mahesh Palamuttath\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/00d89353284b55ed6241c1bac1dd47307f2846529b1e29a5e486af8f9ca08da4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/00d89353284b55ed6241c1bac1dd47307f2846529b1e29a5e486af8f9ca08da4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/00d89353284b55ed6241c1bac1dd47307f2846529b1e29a5e486af8f9ca08da4?s=96&d=mm&r=g\",\"caption\":\"Mahesh Palamuttath\"},\"description\":\"A passionate technophile with post-graduation in Library and Information Science, primarily uses Debian GNU\\\/Linux and FOSS. besides, love to cook and travel\",\"sameAs\":[\"http:\\\/\\\/maheshpalamuttath.info\"],\"url\":\"https:\\\/\\\/maheshpalamuttath.info\\\/index.php\\\/author\\\/maheshpalamuttath\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automating WordPress Backups with a Shell Script | MAHESH PALAMUTTATH","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:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/","og_locale":"en_US","og_type":"article","og_title":"Automating WordPress Backups with a Shell Script | MAHESH PALAMUTTATH","og_description":"In the digital age, data is invaluable, especially for websites that rely on content management systems like WordPress. Regular backups are essential to safeguard your website against data loss due to various reasons, including server failures, malware attacks, or accidental deletions. In this post, we&#8217;ll walk through a shell script designed to automate the backup &hellip; Continue reading \"Automating WordPress Backups with a Shell Script\"","og_url":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/","og_site_name":"MAHESH PALAMUTTATH","article_published_time":"2024-10-29T15:41:32+00:00","article_modified_time":"2024-10-29T16:05:40+00:00","og_image":[{"width":1000,"height":420,"url":"https:\/\/maheshpalamuttath.info\/wp-content\/uploads\/2024\/10\/new_wp-1-1.png","type":"image\/png"}],"author":"Mahesh Palamuttath","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mahesh Palamuttath","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/#article","isPartOf":{"@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/"},"author":{"name":"Mahesh Palamuttath","@id":"https:\/\/maheshpalamuttath.info\/#\/schema\/person\/43e1a3239c44ffb33cfa718d11a76226"},"headline":"Automating WordPress Backups with a Shell Script","datePublished":"2024-10-29T15:41:32+00:00","dateModified":"2024-10-29T16:05:40+00:00","mainEntityOfPage":{"@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/"},"wordCount":703,"commentCount":0,"image":{"@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2024\/10\/new_wp-1-1.png?fit=1000%2C420&ssl=1","keywords":["Backup"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/","url":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/","name":"Automating WordPress Backups with a Shell Script | MAHESH PALAMUTTATH","isPartOf":{"@id":"https:\/\/maheshpalamuttath.info\/#website"},"primaryImageOfPage":{"@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/#primaryimage"},"image":{"@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2024\/10\/new_wp-1-1.png?fit=1000%2C420&ssl=1","datePublished":"2024-10-29T15:41:32+00:00","dateModified":"2024-10-29T16:05:40+00:00","author":{"@id":"https:\/\/maheshpalamuttath.info\/#\/schema\/person\/43e1a3239c44ffb33cfa718d11a76226"},"breadcrumb":{"@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/#primaryimage","url":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2024\/10\/new_wp-1-1.png?fit=1000%2C420&ssl=1","contentUrl":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2024\/10\/new_wp-1-1.png?fit=1000%2C420&ssl=1","width":1000,"height":420},{"@type":"BreadcrumbList","@id":"https:\/\/maheshpalamuttath.info\/index.php\/2024\/10\/29\/automating-wordpress-backups-with-a-shell-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/maheshpalamuttath.info\/"},{"@type":"ListItem","position":2,"name":"Automating WordPress Backups with a Shell Script"}]},{"@type":"WebSite","@id":"https:\/\/maheshpalamuttath.info\/#website","url":"https:\/\/maheshpalamuttath.info\/","name":"MAHESH PALAMUTTATH","description":"LINUX, FOSS &amp;  LIBRARY TECHNOLOGIST","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/maheshpalamuttath.info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/maheshpalamuttath.info\/#\/schema\/person\/43e1a3239c44ffb33cfa718d11a76226","name":"Mahesh Palamuttath","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/00d89353284b55ed6241c1bac1dd47307f2846529b1e29a5e486af8f9ca08da4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/00d89353284b55ed6241c1bac1dd47307f2846529b1e29a5e486af8f9ca08da4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/00d89353284b55ed6241c1bac1dd47307f2846529b1e29a5e486af8f9ca08da4?s=96&d=mm&r=g","caption":"Mahesh Palamuttath"},"description":"A passionate technophile with post-graduation in Library and Information Science, primarily uses Debian GNU\/Linux and FOSS. besides, love to cook and travel","sameAs":["http:\/\/maheshpalamuttath.info"],"url":"https:\/\/maheshpalamuttath.info\/index.php\/author\/maheshpalamuttath\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2024\/10\/new_wp-1-1.png?fit=1000%2C420&ssl=1","jetpack-related-posts":[{"id":835,"url":"https:\/\/maheshpalamuttath.info\/index.php\/2022\/01\/03\/all-the-wordpress-plugins-that-i-use\/","url_meta":{"origin":2044,"position":0},"title":"All the WordPress plugins that I use!","author":"Mahesh Palamuttath","date":"03\/01\/2022","format":false,"excerpt":"WordPress Plugins are PHP scripts that extend the functionality of WordPress. They enhance the features of WordPress or add entirely new features to your site. Plugins are often developed by volunteers and are usually free to the public. Plugins are available via the WordPress Plugin Directory. All you want is\u2026","rel":"","context":"In &quot;WordPress&quot;","block_context":{"text":"WordPress","link":"https:\/\/maheshpalamuttath.info\/index.php\/category\/wordpress\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/Featured-Image6-1.png?fit=1200%2C676&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/Featured-Image6-1.png?fit=1200%2C676&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/Featured-Image6-1.png?fit=1200%2C676&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/Featured-Image6-1.png?fit=1200%2C676&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/Featured-Image6-1.png?fit=1200%2C676&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":677,"url":"https:\/\/maheshpalamuttath.info\/index.php\/2021\/11\/25\/secure-your-pc-with-a-cloud-backup-solution\/","url_meta":{"origin":2044,"position":1},"title":"Secure your PC with a cloud backup solution","author":"Mahesh Palamuttath","date":"25\/11\/2021","format":false,"excerpt":"Recently, It is being seen people lose their laptops\/PC, data and worry about that. One thing we need to keep in our mind is that a computer is just hardware that can be crashed or even theft at any time. So backing up your important data is necessary. You can\u2026","rel":"","context":"In &quot;Pc&quot;","block_context":{"text":"Pc","link":"https:\/\/maheshpalamuttath.info\/index.php\/category\/pc\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":534,"url":"https:\/\/maheshpalamuttath.info\/index.php\/2021\/10\/12\/creating-a-library-website-with-wordpress\/","url_meta":{"origin":2044,"position":2},"title":"Creating a Library Website with WordPress","author":"Mahesh Palamuttath","date":"12\/10\/2021","format":false,"excerpt":"Using WordPress software as a content management solution for your website has many advantages and can provide you with a professional presence for your library or information center. WordPress provides all the tools you need to manage and publish your content online. It is also providing a great platform for\u2026","rel":"","context":"In &quot;Library&quot;","block_context":{"text":"Library","link":"https:\/\/maheshpalamuttath.info\/index.php\/category\/library\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2021\/10\/Screenshot_20211027-062551_Google.png?fit=1080%2C784&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2021\/10\/Screenshot_20211027-062551_Google.png?fit=1080%2C784&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2021\/10\/Screenshot_20211027-062551_Google.png?fit=1080%2C784&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2021\/10\/Screenshot_20211027-062551_Google.png?fit=1080%2C784&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2021\/10\/Screenshot_20211027-062551_Google.png?fit=1080%2C784&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":854,"url":"https:\/\/maheshpalamuttath.info\/index.php\/2022\/01\/07\/using-updraftplus-plugin-for-wordpress-backup\/","url_meta":{"origin":2044,"position":3},"title":"Using UpdraftPlus plugin for WordPress backup","author":"Mahesh Palamuttath","date":"07\/01\/2022","format":false,"excerpt":"Backing up our WordPress website is not a tedious task nowadays, several easy methods are there to backup, You can have your website backup either manually using any control panel of your server or setting up a bash script, or even using the WordPress plugins. Via plugin is the easiest\u2026","rel":"","context":"In &quot;WordPress&quot;","block_context":{"text":"WordPress","link":"https:\/\/maheshpalamuttath.info\/index.php\/category\/wordpress\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/thub-1.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/thub-1.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/thub-1.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/thub-1.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/01\/thub-1.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":751,"url":"https:\/\/maheshpalamuttath.info\/index.php\/2021\/12\/22\/warning-to-the-vintage-koha-users\/","url_meta":{"origin":2044,"position":4},"title":"Warning to the Vintage Koha Users","author":"Mahesh Palamuttath","date":"22\/12\/2021","format":false,"excerpt":"It is being found that Koha software installed via Live CD (vintage versions 3. x) appears to be in error. I do receive a lot of queries on how to recover the crashed koha. Some of the libraries don't even have the backup file. Keep the following in mind The\u2026","rel":"","context":"In &quot;Koha ILS&quot;","block_context":{"text":"Koha ILS","link":"https:\/\/maheshpalamuttath.info\/index.php\/category\/koha-ils\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1347,"url":"https:\/\/maheshpalamuttath.info\/index.php\/2022\/02\/20\/government-college-mokeri-moves-to-koha-ils\/","url_meta":{"origin":2044,"position":5},"title":"Government College Mokeri moves to Koha ILS","author":"Mahesh Palamuttath","date":"20\/02\/2022","format":false,"excerpt":"Government college, mokeri, calicut moves to Koha ILS from BookMagic Software, around 25813 catalog records, patron data were successfully migrated to koha. Thanks to Mr. Lineesh sir, the librarian of the college for your cooperation and support. My every implementation of koha comprises the following Proper data extraction from the\u2026","rel":"","context":"In &quot;Koha ILS&quot;","block_context":{"text":"Koha ILS","link":"https:\/\/maheshpalamuttath.info\/index.php\/category\/koha-ils\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/02\/GCM-LIBRARY-catalog.png?fit=1017%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/02\/GCM-LIBRARY-catalog.png?fit=1017%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/02\/GCM-LIBRARY-catalog.png?fit=1017%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/maheshpalamuttath.info\/wp-content\/uploads\/2022\/02\/GCM-LIBRARY-catalog.png?fit=1017%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/posts\/2044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/comments?post=2044"}],"version-history":[{"count":0,"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/posts\/2044\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/media\/2059"}],"wp:attachment":[{"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/media?parent=2044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/categories?post=2044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maheshpalamuttath.info\/index.php\/wp-json\/wp\/v2\/tags?post=2044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}