From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: Re: mcron job with cd to directory? Date: Wed, 17 May 2017 20:15:17 +0000 Message-ID: <20170517201513.n7okibmk45uujo2k@abyayala> References: <20170517131206.5dt6bv4fyglvxcrn@abyayala> <87bmqruu69.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB5M1-0007eS-HQ for help-guix@gnu.org; Wed, 17 May 2017 16:15:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dB5Lx-0005jQ-GM for help-guix@gnu.org; Wed, 17 May 2017 16:15:29 -0400 Content-Disposition: inline In-Reply-To: <87bmqruu69.fsf@gnu.org> 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: help-guix@gnu.org Ludovic Courtès transcribed 0.9K bytes: > 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 …) > (system* …))) > > See . > > 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/