mirror of
https://github.com/xzeldon/vwdump.git
synced 2025-07-14 23:04:36 +03:00
initial commit
This commit is contained in:
28
start.sh
Normal file
28
start.sh
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
DB_FILE=$DB_FILE
|
||||
BACKUP_FILE=$BACKUP_FILE
|
||||
CRON_TIME=$CRON_TIME
|
||||
BACKUP_CMD=/backup.sh #'/usr/bin/sqlite3 '"$DB_FILE"' ".backup '"$BACKUP_FILE"'"'
|
||||
CRONFILE=/etc/crontabs/root
|
||||
LOGFILE=/var/log/backup.log
|
||||
|
||||
if [ ! -e "$DB_FILE" ]
|
||||
then
|
||||
echo "Database $DB_FILE not found!\nPlease check if you mounted the bitwarden_rs volume with '--volumes-from=bitwarden'"!
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ $(grep -c "$BACKUP_CMD" "$CRONFILE") -eq 0 ]
|
||||
then
|
||||
echo "$CRON_TIME $BACKUP_CMD >> $LOGFILE" >> "$CRONFILE"
|
||||
fi
|
||||
|
||||
pgrep crond > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
/usr/sbin/crond -L /var/log/cron.log
|
||||
fi
|
||||
|
||||
echo "$(date) - Container started" > "$LOGFILE"
|
||||
tail -F "$LOGFILE"
|
Reference in New Issue
Block a user