From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: mcron job with cd to directory? Date: Wed, 17 May 2017 22:04:14 +0200 Message-ID: <87bmqruu69.fsf@gnu.org> References: <20170517131206.5dt6bv4fyglvxcrn@abyayala> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB5BG-0004a2-Kn for help-guix@gnu.org; Wed, 17 May 2017 16:04:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dB5BB-0002EN-Gl for help-guix@gnu.org; Wed, 17 May 2017 16:04:22 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB5BB-0002EJ-EE for help-guix@gnu.org; Wed, 17 May 2017 16:04:17 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:48484 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dB5BA-0003fR-P5 for help-guix@gnu.org; Wed, 17 May 2017 16:04:17 -0400 In-Reply-To: <20170517131206.5dt6bv4fyglvxcrn@abyayala> (ng0@pragmatique.xyz's message of "Wed, 17 May 2017 13:12:06 +0000") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org Howdy ng0, ng0 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 =E2=80=A6) (system* =E2=80=A6))) See . Ludo=E2=80=99.