help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mcron job with cd to directory?


From: ng0
Subject: Re: mcron job with cd to directory?
Date: Wed, 17 May 2017 20:15:17 +0000

Ludovic Courtès transcribed 0.9K bytes:
> Howdy ng0,
> 
> ng0 <address@hidden> skribis:
> 
> > Does someone know how you could re-create this:
> >
> > (crontab -l of root)
> > # Regnerate stagit indexes every hour:
> > 0 * * * * (cd /var/www/git && echo `pwd` && /root/git_pragmatique_xyz.sh)
> >
> > in mcron?
> >
> > I have some cronjobs where the initial
> > current-working-dir must be a specific directory.
> >
> > I think I am missing (lambda) in what I have written below,
> 
> Indeed you are!  :-)
> 
> > but the mcron documentation just
> >
> > (define %stagit-job1
> >   #~(job '(next-hour '(4))
> >            (and
> >             (chdir "/srv/www/git/pragmatique")
> >             (system* "sh" "/root/git_pragmatique.xyz.sh"))))
> 
> Something like:
> 
>   #~(job '(next-hour '(4))
>           (lambda ()
>             (chdir …)
>             (system* …)))
> 
> See 
> <https://www.gnu.org/software/guix/manual/html_node/Scheduled-Job-Execution.html>.
> 
> Ludo’.
> 

Thanks! This fixed at least the respawn-death of mcron. Now I just have to
see if it does what I want.
But it's good to know that it is that easy.
-- 
https://pragmatique.xyz
PGP: https://people.pragmatique.xyz/ng0/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]