{"id":5040,"date":"2022-09-30T07:34:05","date_gmt":"2022-09-30T06:34:05","guid":{"rendered":"https:\/\/www.doncorso.de\/dcwp\/?p=5040"},"modified":"2022-09-30T08:07:07","modified_gmt":"2022-09-30T07:07:07","slug":"mini-sammlung-fuer-rclone-shell-und-crontab","status":"publish","type":"post","link":"https:\/\/www.doncorso.de\/dcwp\/?p=5040","title":{"rendered":"Mini-Sammlung f\u00fcr rclone, shell und crontab"},"content":{"rendered":"\n<p>Lange nix geschrieben und dabei ist das als Notizstelle so praktisch, daher in aller K\u00fcrze:<\/p>\n\n\n\n<p>Um rclone t\u00e4glich Sicherungen in ne Datenwolke zu kopieren brauchts diese Dinge:<\/p>\n\n\n\n<p><strong>Editor \u00e4ndern, wenn man kein B\u00fcndnis mit dem vi-Teufel hat:<\/strong><\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background\">EDITOR=\/opt\/bin\/joe<\/p>\n\n\n\n<p><strong>crontab NICHT mit -e editieren, sondern<\/strong>:<\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background\">joe \/etc\/config\/crontab<\/p>\n\n\n\n<p><strong>Das Skript einf\u00fcgen, das t\u00e4glich sp\u00e4t abends gestartet werden soll:<\/strong><\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background\">11 23 * * * \/opt\/bin\/rclonebitte.sh<\/p>\n\n\n\n<p><strong>neue crontab einlesen und D\u00e4mon neustarten:<\/strong><\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background\">crontab \/etc\/config\/crontab &amp;&amp; \/etc\/init.d\/crond.sh restart<\/p>\n\n\n\n<p><strong>rclone-Befehl in das Skript einf\u00fcgen:<\/strong><\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background\">#!\/bin\/sh<br>\/opt\/bin\/rclone copy \/share\/&lt;lokales_Verzeichnis&gt;\/ &lt;Wolkenname&gt;:&lt;remoteVerzeichnis&gt;\/<\/p>\n\n\n\n<p><strong>optional - erweiterter rclone-Befehl :<\/strong><\/p>\n\n\n\n<p>wenn ich davor sitze und den Fortschritt sehen will, nehme ich \"<em>--progress<\/em>\" mit dazu und wenn ich ein Logfile haben will, gibt es \"<em>--log-file<\/em>\". Au\u00dferdem begrenze ich die Bandbreite gerne auf 90% oder so, dann bleibt noch ein Rest zum normalen Internetbenitzen frei. Dann sieht das so aus:<\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background\"> \/opt\/bin\/rclone --log-file=\/opt\/bin\/rclonebitte.log copy --bwlimit 25M --progress \/share\/&lt;lokales_Verzeichnis&gt;\/ :&lt;remoteVerzeichnis&gt;\/<\/p>\n\n\n\n<p><strong>superoptional - wie lange hat das Sichern gedauert?<\/strong><\/p>\n\n\n\n<p>Mein Log ist sehr viel k\u00fcrzer, es zeigt nur an, wann der Kopierbefehl gestartet und wann er geendet hat. Das reicht mir normalerweise aus. Daf\u00fcr sieht das Skript dann etwas ausfeplusterter aus:<\/p>\n\n\n\n<p class=\"has-light-green-cyan-background-color has-background\">!\/bin\/sh<br><br>zeitpunkt=$(date +\\%Y-\\%m-%d----%H-%M-%S)<br><br>echo \"$zeitpunkt : STARTE Sicherung blabla in die Wolke\" &gt;&gt; \/share\/CE_CACHEDEV3_DATA\/backups\/rcloneLOG.txt<br><br>\/opt\/bin\/rclone --log-file=\/opt\/bin\/rclonebitte.log copy --bwlimit 25M --progress \/share\/&lt;lokales_Verzeichnis&gt;\/ :&lt;remoteVerzeichnis&gt;\/<br><br>zeitpunkt=$(date +\\%Y-\\%m-%d----%H-%M-%S)<br><br>echo \"$zeitpunkt : ENDE Sicherung blabla in die Wolke\" &gt;&gt; \/share\/CE_CACHEDEV3_DATA\/backups\/rcloneLOG.txt<br><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lange nix geschrieben und dabei ist das als Notizstelle so praktisch, daher in aller K\u00fcrze: Um rclone t\u00e4glich Sicherungen in ne Datenwolke zu kopieren brauchts diese Dinge: Editor \u00e4ndern, wenn man kein B\u00fcndnis mit dem vi-Teufel hat: EDITOR=\/opt\/bin\/joe crontab NICHT mit -e editieren, sondern: joe \/etc\/config\/crontab Das Skript einf\u00fcgen, das t\u00e4glich sp\u00e4t abends gestartet werden <a href=\"https:\/\/www.doncorso.de\/dcwp\/?p=5040\" class=\"more-link\">...weiterlesen<span class=\"screen-reader-text\"> \"Mini-Sammlung f\u00fcr rclone, shell und crontab\"<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/posts\/5040"}],"collection":[{"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5040"}],"version-history":[{"count":4,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/posts\/5040\/revisions"}],"predecessor-version":[{"id":5044,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/posts\/5040\/revisions\/5044"}],"wp:attachment":[{"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}