Hallo,
ich synce als Backup 3 lokale Ordner mit Unterordner in ein virtuelles Laufwerk von pCloud. Der pCloud Dienst ladet diese dann selber in die Cloud hoch. Er speichert die Dateien in einem Cache zwischen.
Nun zum "Problem": Mit rsync kopiere ich die Inhalte der 3 Ordner in das virtuelle. Ich drossle das kopieren mit der Bandbreite, welches mein Upload in etwa hat. Damit der pCloud Dienst Zeit hat die Dateien hoch zu laden und der lokale Cache nicht zu groß wird.
Aber: wenn die Internetverbindung wegbricht oder sehr langsam wäre, würde der Cache extrem groß werden und könnte passieren das die Platte voll wird.
Drum prüfe ich zyklisch jede Stunde den Cache und stoppe rsync bis dieser wieder unter die Schwelle fällt.
Aber so ganz rund ist das noch nicht.
Frage: Kann ich rsnc pausieren und dann wieder fortsetzen? Die besonderheit, wenn ich den Pause sende, soll er aber noch das aktuelle File ferig kopieren
mit -partiel möchte ich nicht arbeiten, da ein "halbes" File wohl vom Dienst hochgeladen wird und wenn er das File fertig stellt, würde der pCloud Dienst wohl nochmal das ganze File hochladen.
Mein Script das jede Stunde über den Cron gestartet wird bis dato:
syncpCloud.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #!/bin/bash pid=$(pgrep rsync) cacheSize=$(du -sb ~/.pcloud/Cache | cut -f1) cacheSizeH=$(du -sh ~/.pcloud/Cache | cut -f1) echo "Sync lokal folder to pCloud startet. Current cache size from pCloud is $cacheSizeH" logger "Sync lokal folder to pCloud startet. Current cache size from pCloud is $cacheSizeH" # 7GB = 7516192768 bytes if [ $cacheSize -gt 7516192768 ]; then echo "Cache from pCloud drive is over 7GB and kill rsync if its running" logger "Cache from pCloud drive is over 7GB and kill rsync if its running" killall syncpCloud.sh killall rsync exit 1 fi if [ -z "$pid" ] then echo "rsync ist not running and sync to pCloud drive start now" logger "rsync ist not running and sync to pCloud drive start now" rsync -ahP --bwlimit=5300 --stats /media/Daten// /media/pCloud/Daten/ rsync -ahP --bwlimit=5300 --stats /media/Multimedia/ /media/pCloud/Multimedia rsync -ahP --bwlimit=5300 --stats /media/Files/ /media/pCloud/Files else echo "rsync is already running with the pids \n$pid\nand skip the sync to the pCloud drive" logger "rsync is already running with the pids $pid and skip the sync to the pCloud drive" exit 1 fi |
Übrigens: der rsync ist mit ps aux 3x enthalten ... sollte der nicht einmal drinnen sein? Er kopiert ja nach ein ander
Er soll also, wenn der Cache 7GB erreicht das aktuelle File fertig stellen und dann warten bis der Cache wieder unter die 7GB fällt und fortsetzen wo er pausiert hat.
Ist das so möglich?
Und es wäre schön den aktuellen Status (also welches File wird gerade kopiert) zu sehen. Ausgabe von rsync in ein log File umleiten oder kann man mit einem befehl sehen was er grad macht?
Danke
Moderiert von Taomon:
Schieb.