Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

prevent browsers from starting when rsync is actively syncing

  • Loading branch information...
commit 40c34d94cc5d4b94607235ba6eb8a693d99a4624 1 parent afd01d8
@graysky2 authored
Showing with 10 additions and 2 deletions.
  1. +4 −0 CHANGELOG
  2. +6 −2 profile-sync-daemon
View
4 CHANGELOG
@@ -1,3 +1,7 @@
+v5.09
+19-Dec-2012
+Added option to deny access to sync target while initial rsync is active (aesiris).
+
v5.08
02-Dec-2012
Added profile size display to output.
View
8 profile-sync-daemon
@@ -2,7 +2,7 @@
# By graysky <graysky AT archlinux DOT us>
# Inspired by some code originally written by Colin Verot
export BLD="\e[01m" RED="\e[01;31m" GRN="\e[01;32m" YLW="\e[01;33m" NRM="\e[00m"
-VERS="5.08"
+VERS="5.09"
if [[ ! -f /etc/psd.conf ]]; then
echo "Cannot find /etc/psd.conf so bailing. Reinstall package to use Profile-sync-daemon." # nothing to do if there is no conf file
@@ -190,7 +190,7 @@ parse_conf_file() {
for item in ${DIRArr[@]}; do
DIR="$item"
[[ "$browser" = "firefox" ]] || [[ "$browser" = "heftig-aurora" ]] && suffix="-${item##*/}" || suffix=
- psize=$(du -Lh --max-depth=0 $DIR 2>/dev/null | gawk '{ print $1 }') # profile dir size
+ psize=$(du -Lh --max-depth=0 $DIR 2>/dev/null | awk '{ print $1 }') # profile dir size
if [[ -d "$DIR" ]]; then
echo -en " ${BLD}browser/psname:"
echo -e "$(tput cr)$(tput cuf 17) $browser/$PSNAME"${NRM}
@@ -263,7 +263,11 @@ do_sync() {
if [[ -e $DIR/.flagged ]]; then
rsync -aog --delete-after --delay-updates --exclude .flagged "$DIR/" "$BACKUP/"
else
+ # initial sync
+ # keep user from launching browser while rsync is active
+ chmod -rwx $DIR
rsync -aog --delay-updates "$BACKUP/" "$DIR/"
+ chmod +rwx $DIR
touch "$DIR/.flagged"
fi
fi
Please sign in to comment.
Something went wrong with that request. Please try again.