{"id":149,"date":"2008-01-13T17:34:20","date_gmt":"2008-01-13T16:34:20","guid":{"rendered":"http:\/\/jerome.harckmans.be\/?p=149"},"modified":"2008-01-13T17:34:20","modified_gmt":"2008-01-13T16:34:20","slug":"backup-to-avoid-the-worst","status":"publish","type":"post","link":"https:\/\/jerome.harckmans.be\/?p=149","title":{"rendered":"Backup to avoid the worst"},"content":{"rendered":"<p>Since I bought my external <a href=\"http:\/\/jerome.harckmans.be\/?p=119\" title=\"New Lacie\">Lacie HD<\/a>, I must have backed up my data only once, just before shrinking a partition (quite a delicate operation) on my main computer. Then I realised some days ago that if something really bad happens on this computer (which is going on its 3 years old), I would lost all my photos, music, websites development files, documents, etc. To avoid that catastrophic situation and force me to backup data, I wrote a shell script automatically executed everyday by cron.<\/p>\n<p>Of course, running the script everyday without the Lacie HD switched on wouldn&#8217;t be very useful. That&#8217;s why I used the <strong>&#8220;xmessage&#8221;<\/strong> command to warn me that I shall switch the drive on and retry the script or quit. Everything is performed by the script and adding the following line to <strong>&#8220;\/etc\/crontab&#8221;<\/strong> will make the script to be run everyday at 20:00 sharp:<\/p>\n<div class=coding>\n00 20   * * *   harck   export DISPLAY=:0 &#038;&#038; \/home\/harck\/scripts\/backAll.sh\n<\/div>\n<p>The <strong>&#8220;export DISPLAY=:0 &#038;&#038;&#8221;<\/strong> stuff is necessary for xmessage to work. A copy of the script is available <a href=\"files\/backAll_web.txt\" title=\"grab the file\">here<\/a> (simply rename it into *.sh and <strong>chmod<\/strong> it to 755).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since I bought my external Lacie HD, I must have backed up my data only once, just before shrinking a partition (quite a delicate operation) on my main computer. Then<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,6],"tags":[],"_links":{"self":[{"href":"https:\/\/jerome.harckmans.be\/index.php?rest_route=\/wp\/v2\/posts\/149"}],"collection":[{"href":"https:\/\/jerome.harckmans.be\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jerome.harckmans.be\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jerome.harckmans.be\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jerome.harckmans.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=149"}],"version-history":[{"count":0,"href":"https:\/\/jerome.harckmans.be\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions"}],"wp:attachment":[{"href":"https:\/\/jerome.harckmans.be\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jerome.harckmans.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jerome.harckmans.be\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}