ab6372fa79
Mount individual shell scripts (with the `*.sh` extension) inside `/cron-scripts/` in the container. The cron daemon will automatically run these scripts inside the Nextcloud container for you. Write the scripts as if they will run in the Nextcloud container itself.
17 lines
555 B
Bash
Executable file
17 lines
555 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
echo "-------------------------------------------------------------"
|
|
echo " Executing Cron Tasks: $(date)"
|
|
echo "-------------------------------------------------------------"
|
|
|
|
# Loop through all shell scripts and execute the contents of those scripts in the Nextcloud
|
|
# container. It's done this way so that the user may mount more scripts to be executed in addition
|
|
# to the default ones.
|
|
cd /cron-scripts
|
|
for script in *.sh; do
|
|
echo "> Running Script: $script"
|
|
docker exec -i "$1" bash < $script
|
|
done
|
|
|
|
echo "> Done"
|