whats wrong with this crontab

  • pedrotuga
  • Proficient
  • Proficient
  • User avatar
  • Posts: 315

Post 3+ Months Ago

Code: [ Select ]
13 6 * * * /var/backups/mysite/database/backup.sh


it doesnt run... i cant find out why.... runing that exact same command manualy works without any problem... just dont get it.

can anybody help me?

i also try using @daily... but i don't know at what time does it update ( midnight i supose ) and i dont dare to wait a day.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

If the script runs from the command line, it shouldn't have any problems running through crontab. Just to be sure, make sure you're shebang line point to the correct interpreter (the top line of backup.sh point to /bin/bash or whatever shell you need it to) and that you're able to run the script by calling it in that exact manner from anywhere on the filesystem, i.e.:
Code: [ Select ]
# cd ~/
# /var/backups/mysite/database/backup.sh
  1. # cd ~/
  2. # /var/backups/mysite/database/backup.sh


If that all works, perhaps your user doesn't have permissions to run crontabs, though if that were the case, it should tell you when you issue "crontab -e".

Just to verify to you that you wrote it correctly, I read that as "run the backup.sh script every day at 6:13am"
  • pedrotuga
  • Proficient
  • Proficient
  • User avatar
  • Posts: 315

Post 3+ Months Ago

all the permitions were set... i fixeed the error today.

the sh script runs a php script that outputs a .sql file with a backup of a database.
the problem is that i didnt specify the output path so it was ouputing it to /root/home

i added
Code: [ Select ]
cd /var/backup/mysite/database


to the shell scrpit... problem solved, i think.... havent tested it yet ( busy here )

thanks for the quick help this213

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 90 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.