User Tools

Site Tools


computer:ubuntu:minisini_backup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
computer:ubuntu:minisini_backup [2022/12/14 12:02] – angelegt springmcomputer:ubuntu:minisini_backup [2022/12/16 06:20] (current) – [Start des Skripts] springm
Line 7: Line 7:
   mountdir=/mnt/$user/autobackup   mountdir=/mnt/$user/autobackup
   mediaids=(   mediaids=(
- a134880c-d33e-4c70-8227-ea47e6341b1c+    a134880c-d33e-4c70-8227-ea47e6341b1c
     de6ba9c3-cb24-41c0-aea8-a02be20ae30e     de6ba9c3-cb24-41c0-aea8-a02be20ae30e
   )   )
   sourcedirs2backup=(   sourcedirs2backup=(
     /home/lotte     /home/lotte
-    )+  )
      
   LOGFILE=/tmp/rsyncback.log   LOGFILE=/tmp/rsyncback.log
Line 48: Line 48:
   message "Medium mounted. Basedir: $basedir Device: $device"   message "Medium mounted. Basedir: $basedir Device: $device"
      
-  #lastdir=$(ls -tr $basedir| tail -1) 
   lastdir=$(ls -1 $basedir | grep -v lost | tail -1)   lastdir=$(ls -1 $basedir | grep -v lost | tail -1)
   targetdir=$basedir/$(date +%Y-%m-%d)    targetdir=$basedir/$(date +%Y-%m-%d) 
 +  
   if [ ! -d $targetdir ]; then   if [ ! -d $targetdir ]; then
     message "performing backup to $targetdir"     message "performing backup to $targetdir"
Line 74: Line 74:
   # compile-command: "bash /home/springm/projekte/lotte/rsyncback.sh"   # compile-command: "bash /home/springm/projekte/lotte/rsyncback.sh"
   # End:   # End:
 +  
 +===== Start des Skripts =====
 +Eine Stunde nach dem Einschalten, weil sonst nicht sichergestellt ist, dass mit der Anmeldung auch die Sicherungsplatte gemountet ist.
 +Start über '''/etc/rc.local''' (neu anlegen, wenn die Datei nicht existiert, wird auch auf einem Ubuntu 22 trotz systemd ausgeführt). Start über rc.local ist nötig, damit das Skript als '''root''' ausgeführt hat und die Privilegien für den Dateizugriff und das mounten hat.
 +
 +  #!/bin/bash
 +  if [ ! -f /var/run/rsyncbackup ]; then
 +    echo /home/lotte/bin/rsyncbackup.sh | at now+60min 2>&1 > /tmp/rc_local_rsyncbackup.log
 +    touch /var/run/rsyncbackup
 +  fi
 +  exit 0
 +
 +
computer/ubuntu/minisini_backup.1671019330.txt.gz · Last modified: by springm