mirror of
https://github.com/xzeldon/vwdump.git
synced 2025-06-28 09:38:14 +03:00
parent
1a200567eb
commit
d15bbe9467
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# vim: tabstop=2 shiftwidth=2 expandtab
|
# vim: tabstop=2 shiftwidth=2 expandtab
|
||||||
|
|
||||||
#set -ux
|
#set -x
|
||||||
|
|
||||||
BACKUP_CMD="/sbin/su-exec ${UID}:${GID} /app/backup.sh"
|
BACKUP_CMD="/sbin/su-exec ${UID}:${GID} /app/backup.sh"
|
||||||
|
|
||||||
@ -15,7 +15,6 @@ fi
|
|||||||
if [ "$1" = "manual" ]; then
|
if [ "$1" = "manual" ]; then
|
||||||
$BACKUP_CMD
|
$BACKUP_CMD
|
||||||
fi
|
fi
|
||||||
exit 0
|
|
||||||
|
|
||||||
# Initialize cron
|
# Initialize cron
|
||||||
echo "Running as $(id)"
|
echo "Running as $(id)"
|
||||||
@ -23,11 +22,12 @@ if [ "$(id -u)" -eq 0 ] && [ "$(grep -c "$BACKUP_CMD" "$CRONFILE")" -eq 0 ]; the
|
|||||||
echo "Initalizing..."
|
echo "Initalizing..."
|
||||||
echo "$CRON_TIME $BACKUP_CMD >> $LOGFILE 2>&1" | crontab -
|
echo "$CRON_TIME $BACKUP_CMD >> $LOGFILE 2>&1" | crontab -
|
||||||
|
|
||||||
# Start crond if it's not running
|
fi
|
||||||
pgrep crond > /dev/null 2>&1
|
|
||||||
if [ $? -ne 0 ]; then
|
# Start crond if it's not running
|
||||||
|
pgrep crond > /dev/null 2>&1
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
/usr/sbin/crond -L /app/log/cron.log
|
/usr/sbin/crond -L /app/log/cron.log
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restart script as user "app:app"
|
# Restart script as user "app:app"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user