mirror of
https://github.com/DeNNiiInc/Advanced-Raid-Calculator.git
synced 2026-04-17 12:45:59 +00:00
feat: add deployment automation scripts
This commit is contained in:
21
setup-cron.sh
Normal file
21
setup-cron.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get the absolute path to the sync script
|
||||
SYNC_SCRIPT="$(pwd)/sync-and-restart.sh"
|
||||
|
||||
# Make scripts executable
|
||||
chmod +x deploy.sh
|
||||
chmod +x sync-and-restart.sh
|
||||
|
||||
# Add cron job to run every 5 minutes
|
||||
# We use a temporary file to avoid messing up existing crontab
|
||||
crontab -l > mycron
|
||||
# Check if the job already exists to avoid duplicates
|
||||
if grep -q "$SYNC_SCRIPT" mycron; then
|
||||
echo "Cron job already exists."
|
||||
else
|
||||
echo "*/5 * * * * $SYNC_SCRIPT >> $(pwd)/cron.log 2>&1" >> mycron
|
||||
crontab mycron
|
||||
echo "Cron job added."
|
||||
fi
|
||||
rm mycron
|
||||
Reference in New Issue
Block a user