{"id":215,"date":"2008-12-06T00:16:51","date_gmt":"2008-12-05T16:16:51","guid":{"rendered":"http:\/\/blog.wallaceho.com\/?p=215"},"modified":"2008-12-08T01:43:26","modified_gmt":"2008-12-07T17:43:26","slug":"backup-your-mysql-using-a-bash-script-and-cron-job","status":"publish","type":"post","link":"https:\/\/blog.wallaceho.com\/?p=215","title":{"rendered":"backup your MySQL using a bash script and cron job"},"content":{"rendered":"<p>From allenkan.com\/blog<br \/>\nuseful sql backup command<br \/>\n<code>1. dump the DB into a sql file<br \/>\nmysqldump -u<strong> &lt;username&gt;<\/strong> -p<strong>&lt;password&gt;<\/strong> <strong>&lt;database&gt;<\/strong> &gt; <strong>&lt;output file name&gt;<\/strong>.sql<\/p>\n<p>2. compress it<br \/>\ngzip <strong>&lt;Filename&gt;<\/strong><\/p>\n<p>3. Ftp send to backup server<br \/>\n** it is not suggested because backup ftp account and the backup data is sent in plain text format **<\/p>\n<p>ftp -n <strong>$ftpserver <\/strong>&lt;&lt;END_SCRIPT<br \/>\nquote USER <strong>$ftpuser<\/strong><br \/>\nquote PASS <strong>$ftppwd<\/strong><br \/>\nput <strong>$gzipOutFile<\/strong><br \/>\nquit<br \/>\nEND_SCRIPT<br \/>\nexit 0<\/p>\n<p><strong><\/strong><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>From allenkan.com\/blog useful sql backup command 1. dump the DB into a sql file mysqldump -u &lt;username&gt; -p&lt;password&gt; &lt;database&gt; &gt; &lt;output file name&gt;.sql 2. compress it gzip &lt;Filename&gt; 3. Ftp send to backup server ** it is not suggested because &hellip; <a href=\"https:\/\/blog.wallaceho.com\/?p=215\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/posts\/215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=215"}],"version-history":[{"count":6,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":221,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions\/221"}],"wp:attachment":[{"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wallaceho.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}