I try to get crontab to work for a while, but it doesn't seem to want to work. Python script I need to initialize every midnight, work fine with the command terminal. Location of my python script:
/home/rv/ncbi-blast-2.2.23+/database_backup/backup.py
My contab looks like this:
SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin:/home/rv/ncbi-blast-2.2.23+/database_backup MAILTO=root HOME=/
My python script looks like this:
#!/usr/bin/python from subprocess import Popen import datetime today = datetime.date.today() today = str(today) #print today f = open("/home/rv/ncbi-blast-2.2.23+/database_backup/%s.sql" % (today), "w") x = Popen(["mysqldump", "-u", "root", "-p*****", "normalisation"], stdout = f) x.wait() f.close()
Any idea I'm wrong in?
Just looked at the cron logs and I got this for every entry I tried
(root) BAD FILE MODE (/etc/crontab)
I have the same error when I tried with a shell script, and
Craig source share