Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I setup a script for to take an mysql db backup everyday on a specific time, so now the cron is running perfectly it executing the script without problem but the problem is db backup file is not stored in the specific location,but while we executing a script manually in terminal it executing and the files are stored in the specific location perfectly.

I checked the cron logs it's shows all perfectly running, and i check the cron and mysql status it's running perfectly.

help me to solve this issue.

share|improve this question
Are you using in the script absolute paths? – Jan Marek Nov 20 '12 at 8:16
Also if user shell is bash be sure that first line of script is #!/bin/bash. – Laurentiu Roescu Nov 20 '12 at 8:20
By default, cron sends the output of cron jobs (including error messages) as an email to the user it ran as. If you haven't configured a mail relay on your server to forward these on to you, these are probably in flat files in /var/spool/mail/. – Ladadadada Nov 20 '12 at 9:51

Can u tell the user by which your are trying to execute script, add it in crontab for the particular user, where script is run successfully.

crontab -u user -e

share|improve this answer
yes i setup like that only, but still not working.this cron is running in the user of "backup".So i setup the cron in backup user account. – Tilak Raj Nov 20 '12 at 8:32
can u log the output from cron to text file i mean stdout/stderr output of the job /path/to/some/logfile 2>&1 i think u shoud create this file and give permission for backup user to write into it..and see if any errors are there – LINUX4U Nov 20 '12 at 9:51
yes i given a full rights to the backup user to rwx permission. – Tilak Raj Nov 20 '12 at 9:56
Can u post ur crontab entry? – LINUX4U Nov 20 '12 at 9:59
0 8 * * * /srv/deve/cnjimenez/qa_instance/backoffice/application/schedules/mysql‌​ – Tilak Raj Nov 20 '12 at 10:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.