Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

MySQL from crontab

I created a file named "dbrun.sh":
mysql -u zooph -ppass123 -h m.example.com zooph_db < /usr/home/zooph/cron/cron.sql > /dev/null
touch /usr/home/zooph/cron/cron.txt

Open in new window


When I run the file like this the MySQL queries in the MySQL get exicuted:
sh dbrun.sh

Open in new window

However when the crontab does NOT run the SQL dump:
*/1 * * * * sh /usr/home/zooph/cron/dbrun.sh

Open in new window

The "touch" command works but not the MySQL dump.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial