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: Ludovic Courtès
Subject: Re: mcron job with cd to directory?
Date: Wed, 17 May 2017 22:04:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

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’.



reply via email to

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