Page 1 of 1

Post job bash scripts

Posted: August 10th, 2017, 4:19 pm
by havri
Hello,

I added a couple of post job bash scripts that analyze some parts of the log. The problem is that the results I get are different and limited in comparison with when I run them as root through SSH.

These two scripts analyze the jet backup log and put some statistics in a .txt file which after that I export. I looked at the log file and everything seems ok:

Code: Select all

[10/Aug/2017 14:35:22 +0000] Executing post job scripts...
[10/Aug/2017 14:35:22 +0000] 	Executing `/root/scr/myscript.sh -jt`...SUCCESS
[10/Aug/2017 14:35:22 +0000] 	Executing `/root/scr/myscript.sh -jp`...SUCCESS
[10/Aug/2017 14:35:22 +0000] Job Completed.
If I run the same script through a simple cron, the resulted output is correct.

From what I tested, there seems to be a permission or environment issue with the post job scripts. Is there a way to debug this or can someone point me in the right direction? Alternatively, is there a way to add some hooks to run my scripts after the backup job is done?

Thank you.

Re: Post job bash scripts

Posted: August 11th, 2017, 10:03 pm
by alex
It appears to be an issue particular to your environment. Please create a ticket with our help desk by emailing support@jetapps.com or visiting the link below because we MAY need access to your servers and don't want to work over a public forum, for security concerns. Thank you!

https://www.jetapps.com/support

Re: Post job bash scripts

Posted: August 13th, 2017, 9:13 am
by elialum
Hi,

Just a follow up's to Alex's response, please try the following -

1. print the environment from ssh running as root (printenv).
2. do the same from the cron (print output to a file)
3. compare them, add the missing env variables to the cron

For example -

Code: Select all

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /root
export TERM=vt100
export SHELL=/bin/bash
Hope it helps :)

Thanks,
Eli.

Re: Post job bash scripts

Posted: August 13th, 2017, 10:11 am
by havri
Hello,

@alex as a result of tests, I will open a ticket.

@elialum I forgot to update this thread. That's exactly what I did and found out that the env for the jetbackup scripts was empty, so I exported what I needed in the bash script, but the problem still persists.

Thank you.

Re: Post job bash scripts

Posted: December 20th, 2017, 1:13 pm
by elialum
Hi,

Thank you for the update about your issue.
Please let us know if you need further assistance :)

Eli.