{"id":3577,"date":"2013-12-05T01:32:56","date_gmt":"2013-12-05T01:32:56","guid":{"rendered":"http:\/\/www.webputzer.com\/?p=3577"},"modified":"2013-12-05T01:38:46","modified_gmt":"2013-12-05T01:38:46","slug":"automate-a-backup-with-7z-and-a-batch-file","status":"publish","type":"post","link":"http:\/\/www.webputzer.com\/?p=3577","title":{"rendered":"Automate a backup (Windows) with 7z and a batch file"},"content":{"rendered":"<p>This is something which I found worked on Server 2003, and, I presume that it would work on Server 2008. I had a Windows server on one side of town and a Linux server on the other side of town. I wanted to grab a copy, nightly, of a particular mysql database (by just archiving a directory and downloading it, via a Linux cron job at my house). Anyway, this is how you can do something like that \u2013 or simply automate any sort of archiving \u2013 using 7zip on a Windows box.<br \/>\nJust install 7zip and, if I recall correctly, copy the file \u201c7z.exe\u201d to the system32 folder (it will be in the 7zip program directory). Sufficing a clumsy explanation, I\u2019ll just show you the batch file that I used to archive the folder and move it a web accessible spot on IIS \u2013 and then delete the rascal. I just ran the 7zip procedure as a scheduled task<\/p>\n<pre style=\"font-size: 12px;\">\r\n@ECHO OFF\r\n\r\ncd \"C:\\Documents and Settings\\All Users\\Application Data\\MYSQL\\MySQL Server 5.5\\data\"\r\n7z a my_database.zip my_database\r\nmove my_database.zip \"C:\\Inetpub\\wwwroot\\downloads\\my_database.zip\"\r\ncd \"C:\\Inetpub\\wwwroot\\downloads\"\r\nping 1.1.1.1 -n 1 -w 600000>NUL\r\ndel my_database.zip\r\n\r\nexit<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is something which I found worked on Server 2003, and, I presume that it would work on Server 2008. I had a Windows server on one side of town and a Linux server on the other side of town. I wanted to grab a copy, nightly, of a particular mysql database (by just archiving [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3581,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"h5ap_radio_sources":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3577","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/3577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3577"}],"version-history":[{"count":0,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/3577\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/media\/3581"}],"wp:attachment":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3577"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}