Bash script runs manually, but fails on crontab

后端 未结 5 973
逝去的感伤
逝去的感伤 2020-12-06 01:14

I\'m a newbie to shell scripting. I have written a shell script to do incremental backup of MySQL database.The script is in executable format and runs successfully when exec

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-06 01:54

    Just import your user profile in the beginning of the script.

    i.e.:

    . /home/user/.profile
    

提交回复
热议问题