move rsync in a function

 

File modified: bin/bgn.sh

Change333 at Tue Aug 10 20:40:54 2010 +0200 by Ivan Kanis <ivan@tao>

diff -r 970b5d82f21b -r b45618bdabdc bin/bgn.sh
--- a/bin/bgn.sh	Sun Aug 08 19:23:46 2010 +0200
+++ b/bin/bgn.sh	Tue Aug 10 20:40:54 2010 +0200
@@ -19,6 +19,11 @@
     fi
 }
 
+fn_rsync () {
+    ionice -c3 rsync -a --delete ${1} ${2}
+    check "Failed to rsync from ${1} to ${2}"
+}
+
 ALSA_FILE="${HOME}/local/alsa.cnf"
 if test -f "${ALSA_FILE}"
 then
@@ -57,18 +62,16 @@
     ssh-add
     check "password error with  private key"
     updateweb.sh &
-    nice rsync -a ~/lucia /media/Iomega_HDD &
 fi
 wrapper.py emacs &
 firefox > /dev/null 2>&1 &
 
 if test "X${host_name}" = "Xtao"
 then
-    nice rsync -a ~/lucia /media/Iomega_HDD
-    nice rsync -a ${portable_dir}/listen ~/local
-    nice rsync -a ${portable_dir}/zic ~/local
+    fn_rsync ~/lucia ${portable_dir}
+    fn_rsync ${portable_dir}/listen ~/local
+    fn_rsync ${portable_dir}/keep ~/local
 fi
-nice rsync -a ${portable_dir}/keep ~/local
 
 # Local Variables:
 # compile-command: "sh start.sh"


back