Changes by docelic.
[clinton/scripts.git] / hcoop-backup
index 51d4a79..51da992 100755 (executable)
@@ -25,6 +25,8 @@ IFS=$'\n'
 RSYNCDIR=/vicepa/hcoop-backups/files
 rm -fr $RSYNCDIR
 mkdir -p $RSYNCDIR/$CURDATE
+chmod og=rx,u=rwx $RSYNCDIR
+chmod og= $RSYNCDIR/$CURDATE
 
 # Initialize backup staging area
 mkdir -p $BACKUPTMP
@@ -160,6 +162,12 @@ tar -C /var/backups/databases/ -cf - . | \
   ccrypt -k $KEYFILE -e | \
   $MOVE_OVER $CURDATE $F
 
+# Update file permissions so that rsync.net can access the backups
+chmod -R go=,u-w $RSYNCDIR/$CURDATE
+chmod u+w $RSYNCDIR/$CURDATE
+chown -R rsync $RSYNCDIR/$CURDATE
+
+# Complain to admins if there are unknown files
 grep '[a-z/]' complain && \
   mail -a 'From: The Backup Program <backups@deleuze.hcoop.net>' \
        -s "automated message: annoying files found on deleuze (please do something about them)" admins@hcoop.net \