Tag Info

Hot answers tagged

3

The shell variable $$ contains the PID of the current running script. You could use it like this: echo $$ >/tmp/backup_pid


2

IBM AIX 5.3 has a crontab command which allows you to submit, edit, list, and removes cron jobs. If you are the root user, you can use the crontab feature. If you do not have root access, your login has to be added to the cron.allow file and at the same time not in cron.deny. The cron.allow and cron.deny files are located under the /var/adm/cron directory.


2

There is no universal etiquette regarding use of cron. Every system is different and may have its own policies, of which you may have been notified when getting access. It's worth noting that system administrators have the capability to enable/disable crontab for users, so, if you have access to crontab then arguably this is a tacit approval. That said, ...


1

If you want to get PID: pgrep Process ###Write process name instead of "Process"### If you want to get PID and kill process from GNOME Terminal: pid=$(pgrep Process) && kill -9 $pid If you want to end a task with shell scripting: pdi=$pgrep Process) kill -9 $pid Or write PID to a file: pgrep Process > ...


1

It's difficult to answer accurately as there is different versions of cron with potentially varying accuracy. NTP will definitively be a must for a solution like this, and use ntpd instead of ntpdate, as ntpd will constantly adjust the "length of a second" to the correct length of a second as opposed to ntpdate which just sets the time and allows it to ...


1

Use a .pgpass file under the home directory of the user who the cron job runs as. See the manual.



Only top voted, non community-wiki answers of a minimum length are eligible