Line 112... |
Line 112... |
112 |
# sync last updated folders |
112 |
# sync last updated folders |
113 |
syncdir audio/"$LAST" -a |
113 |
syncdir audio/"$LAST" -a |
114 |
syncdir capture/"$LAST_HOUR" -a |
114 |
syncdir capture/"$LAST_HOUR" -a |
115 |
syncdir data/"$LAST" -a |
115 |
syncdir data/"$LAST" -a |
116 |
syncdir data --dirs --delete |
116 |
syncdir data --dirs --delete |
117 |
syncdir . --dirs --delete |
- |
|
118 |
|
117 |
|
119 |
# days changed, sync whole yesterday too |
118 |
# days changed, sync whole yesterday too |
120 |
if [ "$LAST" != "$OLD" ] |
119 |
if [ "$LAST" != "$OLD" ] |
121 |
then |
120 |
then |
122 |
info "syncing yesterday" |
121 |
info "syncing yesterday" |
Line 140... |
Line 139... |
140 |
date |
139 |
date |
141 |
|
140 |
|
142 |
# save only tail from logfile |
141 |
# save only tail from logfile |
143 |
tail -n 1000 "$1"/logfile > "$1"/logfile.txt |
142 |
tail -n 1000 "$1"/logfile > "$1"/logfile.txt |
144 |
rm "$1"/logfile |
143 |
rm "$1"/logfile |
- |
|
144 |
syncdir . --dirs --delete > /dev/null 2>&1 |
145 |
exec > >(tee "$1"/logfile) |
145 |
exec > >(tee "$1"/logfile) |
146 |
exec 2>&1 |
146 |
exec 2>&1 |
147 |
|
147 |
|
148 |
# wait for a next syncing period |
148 |
# wait for a next syncing period |
149 |
sleep $FREQUENCY |
149 |
sleep $FREQUENCY |