Skip to content

Commit

Permalink
ajout script cron
Browse files Browse the repository at this point in the history
  • Loading branch information
syji35 committed Nov 22, 2023
1 parent e7078df commit 1f8f01d
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -18,6 +18,10 @@ RUN apt update \
&& apt-get clean -y \
&& rm -rf /var/lib/{apt,dpkg,cache,log,tmp}/*

# copie des cron
COPY lufi-cron /etc/cron.d/lufi-cron
RUN chmod 0644 /etc/cron.d/lufi-cron

RUN cpan Carton
WORKDIR /lufi

1 change: 1 addition & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ if [ "$command" = "start" ]; then
carton exec hypnotoad /lufi/script/lufi
elif [ "$command" = "cron" ]; then
echo "Exécution des cron"
cron -f
# Ajoutez ici la commande que vous souhaitez exécuter pour "commande2"
else
echo "Commande non reconnue: $command"
2 changes: 2 additions & 0 deletions lufi-cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0 2 * * * root cd /lufi && carton exec script/lufi cron cleanfiles --mode production
0 4 * * * root cd /lufi && carton exec script/lufi cron cleanbdd --mode production

0 comments on commit 1f8f01d

Please sign in to comment.