forked from raylim/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup.sh
More file actions
executable file
·25 lines (24 loc) · 1013 Bytes
/
backup.sh
File metadata and controls
executable file
·25 lines (24 loc) · 1013 Bytes
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
PID=~/.backup.pid
TMP=`mktemp`;
if [[ -z `pgrep -F $PID | xargs ps | grep rsync` ]]; then
cd /ifs/e63data/reis-filho/ && \
find data projects -type d \
\( -name bam -o -name tables -o -name alltables -o -name vcf \) \
! -path "*/log/*" ! -path "*/tmap/*" ! -path "*/gatk/*" ! -path "*/hydra/*" ! -path "*/bwa/*" \
! -path "*/varscan/*" ! -path "*/mutect/*" ! -path "*/scalpel/*" ! -path "*/som_sniper/*" ! -path "*/rawdata/*" \
! -path "*/unprocessed_bam/*" ! -path "*/defuse/*" ! -path "*/chimscan/*" -print0 > ${TMP}
while [ 1 ]; do
cd /ifs/e63data/reis-filho/ && \
rsync --verbose --progress --stats --recursive --append --partial -a -0 --files-from=${TMP} --prune-empty-dirs ./ /mount/limr/zedshared
echo $! > $PID
if [ "$?" = "0" ]; then
echo "rsync complete"
exit
else
echo "rsync failure, retrying in 1 minute..."
sleep 60
fi
done
rm $PID
rm ${TMP}
fi