Cron Job on Ubuntu Hardy Executing but not deleting files as expected

I have some pickle here and wondering if anyone can give me some pointers:

I have a cron job that runs for a specific user per day and needs to move files in a specific directory. Technically, these are two jobs. I included cron.log to make sure they are actually running and they:

May 24 11:03:01 AppNameGoesHere /USR/SBIN/CRON[11257]: (mongrel_AppNameGoesHere) 
  CMD (rm -rf /var/www/apps/AppNameGoesHere/current/public/
  {popular,index,purchasing,purchasing-alternate,support,about-us,guarantee,screenshots}.htm{,l})
May 24 11:04:01 AppNameGoesHere /USR/SBIN/CRON[11260]: (mongrel_AppNameGoesHere)
  CMD (rm -rf /var/www/apps/AppNameGoesHere/current/public/
  {stats,popular,bcf,articles,expenses})

      

I removed the actual usernames and formatted them so that it is less ugly on StackOverflow.

Now, my question is, even though I can see that these deletes are being performed and apparently succeed in the log, if I go to the specified directory, the files still exist. At first I suspected that the hijinx permission was continuing, but I verified that I could manually delete the files manually by logging in as user mongrel_AppNameGoesHere and issuing separate rm commands or by copying / pasting the cron job into the command line. Anything I don't do manually stays unblocked even though the days of a successful cron job are running successfully.

Any suggestions on what might happen? I used to use Dapper Drake with these cron jobs in / etc / crontab, and when I upgraded to Hardy, I moved them to custom crontabs (via sudo crontab -e - u mongrel_AppNameGoesHere

) and that was where they seemed to stop working.)

+1


a source to share


1 answer


The problem is that {} is part of the shell extension provided by the shell, so you need to change the shell doing the cron entries to do this job.

The default is / bin / sh, so just put:



SHELL = / bin / bash

as the first line in your crontab so that things can start working again.

+6


a source







All Articles