From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: mcron job with cd to directory? Date: Wed, 17 May 2017 13:12:06 +0000 Message-ID: <20170517131206.5dt6bv4fyglvxcrn@abyayala> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAykP-0006eK-Oo for help-guix@gnu.org; Wed, 17 May 2017 09:12:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAykM-0004a7-3x for help-guix@gnu.org; Wed, 17 May 2017 09:12:13 -0400 Received: from 93-95-228-241.1984.is ([93.95.228.241]:48788 helo=sharknado9001.pragmatique.xyz) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dAykL-0004Yl-O3 for help-guix@gnu.org; Wed, 17 May 2017 09:12:10 -0400 Received: by sharknado9001.pragmatique.xyz (OpenSMTPD) with ESMTPSA id 4f9567ae (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Wed, 17 May 2017 13:11:56 +0000 (UTC) Content-Disposition: inline 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 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, 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")))) (define %stagit-job2 #~(job '(next-hour '(4)) (and (chdir "/srv/www/git/ng0") (system* "sh" "/root/git_ng0.sh")))) Of course we all know that the longterm fix is to write an Guix service for stagit which allows multiple targets, because stagit's example.sh is just that, an example ;) -- https://pragmatique.xyz PGP: https://people.pragmatique.xyz/ng0/