Update backup service to use periodic execution with curl
The Dockerfile now uses a loop to run the backup script every 60 seconds. Added `curl` installation and a curl command in `backup.sh` for external script execution. Removed unused echo statements for clarity.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
FROM ubuntu:latest
|
||||
LABEL authors="Jeppe B"
|
||||
RUN apt-get update && apt-get install -y cron
|
||||
RUN apt-get update && apt-get install -y cron curl
|
||||
COPY backup.sh /backup.sh
|
||||
RUN chmod +x /backup.sh
|
||||
# Set the timezone
|
||||
RUN ln -fs /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime
|
||||
# Send a message, and run the backup script
|
||||
CMD echo "Backup service is running" && /backup.sh
|
||||
# Loop sleep, run backup.sh every 60 seconds
|
||||
CMD while true; do /backup.sh; sleep 60; done
|
||||
@@ -1,3 +1,7 @@
|
||||
# Show the script is running
|
||||
echo "Backup script started at $(date)"
|
||||
# TODO: Implement the script here
|
||||
#echo "Backup script started at $(date)"
|
||||
#echo "Auth key: $auth_key"
|
||||
# Curl the backup script
|
||||
curl -s "https://nnks.truckwash.dk/?internalCronCall=true&script=run&action=cron&auth_key=$auth_key"
|
||||
# Show the script has finished
|
||||
#echo "Backup script finished at $(date)"
|
||||
Reference in New Issue
Block a user