scripts nor working in crontab

Latest response

Server: Red Hat Enterprise Linux Server release 7.4

My script contains only:
curl -u admin:123!@ -X POST http://localhost:4502/system/console/jmx/com.adobe.granite:type=Repository/op/startBackup/java.lang.String?target=/opt/prod_auth_backup/

Crontab entry:
30 14 * * * /bin/bash /opt/scripts/backup_author.sh

I can manually run the script but its not working in crontab.I already tried couple of things from below URLs but did not help.
https://access.redhat.com/discussions/3450011
https://serverfault.com/questions/748835/linuxredhatcrontab-bash-script-working-from-shell-but-not-in-crontab-ass

regards
Sina

Responses

  1. When posting code snippets, use the requisite code tags. Makes things a lot easier for your readers to parse your post. See the "Formatting Help" link for appropriate MarkDown to use for code.
  2. Whenever you have a URL that has "special" characters in it, it's a good idea to protect those characters with either single- or double-quotes around the URL.
  3. Beyond the above, it's hard to provide assistance without relevant error-logs.

1) Updated the only line i have in my script.

2) here is my latest URL

curl -u admin:123!@ -X POST http://localhost:4502/system/console/jmx/com.adobe.granite:type=Repository/op/startBackup/java.lang.String?target=/opt/prod_auth_backup/

3)Which error logs you are refereeing.I dont see anything in /var/log/message and in /var/log/cron Jul 5 16:08:01 localhost CROND[3891]: (root) CMD (/bin/bash /opt/scripts/backup_author.sh)

I found the issue!my bad spelling mistake in the script name in crontab.

Thanks for letting us know Mohammad,

-RJ

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.