added lock file support to the sync script..

This commit is contained in:
Alper Kanat 2008-11-03 23:44:20 +00:00
parent 9359621759
commit 71fe742fc3

13
sync
View File

@ -2,5 +2,16 @@
# sync.sh # sync.sh
# #
# this script is written to syncronize the lkd planet.. # this script is written to syncronize the lkd planet..
#
# author: Alper KANAT <alper.kanat@linux.org.tr>
./planet.py gezegen/config.ini &> logs/planet-$(date +"%d.%m.%Y-%H:%M").log & PLANET_DIR="${HOME}/public_html/gezegen"
LOCK_FILE="planet-sync.lck"
if [[ -f "$PLANET_DIR/$LOCK_FILE" ]]; then
echo "there's a sync process running behind, please try again later.." &> logs/planet-$(date +"%d.%m.%Y-%H:%M").log &
exit 1
else
./planet.py gezegen/config.ini &> logs/planet-$(date +"%d.%m.%Y-%H:%M").log &
touch "$PLANET_DIR/$LOCK_FILE"
fi