I'd downloaded audit_purge.sh from the community and I'd like to set a cron job for executing this script every day.
I tried to run command "crontab -e" but no this command.
How do I do to make this script run every day?
I finally found the root cause and it's my fault.
Cron is really not there because my engineer used to change the version of MySQL from embedded to community.
He uses yum to uninstall MySQL so several dependency packages have been removed
If somebody encounters the same situation, here's the workaround.
- download these packages.
cronie-1.4.4-16.el6_8.2.x86_64 cronie-anacron-1.4.4-16.el6_8.2.x86_64 crontabs-1.10-33.el6.noarch
- install sendmail first.
- install cronie-1.4.4-16.el6_8.2.x86_64 with --nodeps (It shows error if --nodeps is not there.)
- install crontabs-1.10-33.el6.noarch
- install cronie-anacron-1.4.4-16.el6_8.2.x86_64
Thanks all of you
the crontab -e should display a new file in vi (if you haven't setup a cronjob already)
In here you will need to add the audit_puge entry as mentioned in https://comm.support.ca.com/kb/configuring-and-installing-the-audit-record-maintenance-script/kb000042480
You will then need to save that file using :wq
What exactly on this command is not working for you?
I uploaded the script(audit_purge.sh) to the gateway and ran it manually with no problem.
When I try to set it as a cron job, I enter "crontab -e" in gateway's terminal and the terminal shows me this message.
-bash: crontab: command not found
That's why I'd like to know how to set it as a cron job.
Thanks for the response.
What form factor of the gateway are you using?
In the virtual and hardware appliance of the gateway the crontab should be available.
I deployed the gateway from an ova file.
The version of the gateway is 9.4 and the OS type is CentOS.
I saw there're several cron related file and directory under /etc folder.
How did you get to the command prompt and what user are you using?
It may be something related to user rights and/or profile if you are not using the default user.
First I use ssgconfig through ssh.
Then I use option 3 to login to privileged console.
I use whoami command to check my account, it’s root.
I tried to use rpm -qa to search cron related package but nothing be found.
If I need to install cron bymyself, what rpm package should I install?
based on what is installed on my test gateway this should be:
Unfortunately, when I used rpm -qa cron command, it returns me nothing.
How can I install the package by myself?
I tried to use yum install -y crontabs or cronie but failed.
you may try the command,
rpm -aq |grep cron
the appliance gateway has cron installed by default, you should see the same as posco01 shows.
and the appliance gateway doesn't have yum installed.
Retrieving data ...