Thanks for all the tips!
Im going to try an answer every post, here I go:
@koen 1. Yes it works when I run it manually (every part of the script does)
2. No I haven't suppressed any output from cron. The only part where I found cron output was in syslog, but nothing relevant, only stuff like this:
Code:
Oct 15 12:17:01 openbravo CRON[18181]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 15 12:25:01 openbravo CRON[18361]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 15 12:35:01 openbravo CRON[18544]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 15 12:45:01 openbravo CRON[18728]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 15 12:55:01 openbravo CRON[18947]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 15 13:05:01 openbravo CRON[19132]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 15 13:15:01 openbravo CRON[19316]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 15 13:17:01 openbravo CRON[19326]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
No idea what any of that means.
Also, regarding your wild guess, I also tought about that and switched the commands order, but same result, the file in fact gets copied succesfully.
@LHammonds
1. Script is scheduled to run as root and I always stop the service using sudo (if im not root at that time) so no problems there. I will also try and improve the script to check the return codes and make the script a little more professional.
regarding your EDIT#1 part, I just implemented this, lets see if it makes any difference.
I also added a PATH to the crontab file as suggested by you and @steeldriver (I included the PATH on your webpage)
I have a question regarding this...am I opening a security hole while adding non-default paths to a root crontab?
@HermanAB the openbravo script in fact shutdowns a couple processes:
Code:
start() {
service openbravo-postgresql start
service openbravo-tomcat start
service apache2 status >/dev/null 2>&1 || service apache2 start
}
stop() {
service openbravo-tomcat stop
service openbravo-postgresql stop
thanks all! hopefully this changes will make it work
Bookmarks