Skip to content

How to make changes to Netezza cron job under NZ account?

When we make changes to crontab on Netezza server (active node), it is not automatically changed to crontab on secondary node, because crontab under nz account is not shared between nodes. Each node have its own crontab. SO, when ever we make changes on the primary node we have to make sure that same changes are made on scondary node as well. Here is the steps to follow when we make changes to crontab in Netezza.

1) Connect to active node (say NzServer1_1a or use logical name) from putty and take a backup of current crontab

crontab -l>crontab.dat

Optional : If you have already have a backup of crontab, you can compare the backup with current crontab to make sure their are no changes made to crontab which are not in backup file.

crontab -l|diff - crontab.dat

2) Make required changes to crontab.dat using vi editor

vi crontab.dat

3) Now apply this changes to actual crontab

crontab crontab.dat

4) Now, to propagate these changes to secondary node you have to first connect to the secondary node (say NzServer1_2a) from putty and navigate to /tmp directory.

Then make a sftp to the active node.

sftp NzServer1_2a

5) Now navigate to the path where you have takenĀ  a backup of crontab in primary node. Then issue a command

get crontab.dat

6) Run below command to apply this crontab changes to secondary node.

crontab crontab.dat

7) Now crontab is in sync on both the nodes.