I am trying to simplify things for two people who will be taking over my role whilst i go on leave. In doing so, i wanted to find a way that upon login to unix, the crontab would be reloaddd and resaved.
I want to do this due to our IT dept taking the server down more often of late and therefore deactiving the cron from running. I feel it would be simplier for these people to just log in to the system to re establish the crontab rather than them having to edit and save it. They have no unix or vi knowledge and would also cut procedure down.
Reload is just reading the file with crontab:
But if the service isnt availabe...
So what does you IT do? stop the service ? or remove all found cronfiles in /var/spool/cron/crontabs ? In which case you keep a copy in your home directory and reload as mentionned above, then to modify you modify your file with vi rather than crontab -e
then you can compare if what is scheduled matches what you have by comparizon with your original file etc... You could create an alias to load if you want...
The crontab info remains but when the server gets rebooted, the crontab is no longer active and every time i must do a crontab -e and save it again.
I was looking for a way to include this in a .profile so that upon login it auto edits and saves again so it ensures it remains active.
I rather this approach for handing the task to people when im on keave as all i have to tell them do is to log in when the automated process i have created fails to ever run.
As to what out IT dept does...very good q...they tell the company what they will do rather than ask how they can help...the cron file location was locked off for viewing so i coulsnt access the folder.
Thanks for the info. I shall give the command you mentioned a whirl
I know it ceases to re activate as i have had many times where my process fell over because they took the server down and, when it came back up, my crontab just never executed at the times it was meant to. These times were well after their taking down of the server.
All right. Well, here's an idea. Try putting in the .profile the following:
On my linux computer, that reinstalls the crontab. No change to the file contents. But the timestamp on the crontab file under /var/spool/cron/crontabs is changed to the current time.
There is also "crontab -r" to remove the crontab that you could put in between the two lines above, if needed as another attempt to make cron read the crontab in your unusual situation.
I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below:
Core Utilization
CoreId %Usr %Sys %Total
------ ----- ----- ------
5 4.91 0.01 4.92
6 0.06 ... (0 Replies)
How to save crontab?
I have try both method below but can't save it.
FIRST METHOD error message
hit 'escape' and then the following:
:wq
http://i.imgur.com/nY2YI.jpg
SECOND METHOD error message
ctrl + s
http://i.imgur.com/ECzl0.jpg (3 Replies)
Hi,
I'm trying to save a crontab configuration using SSH, acessing a Linux machine from a Windows desktop.
So, in the prompt I type "crontab -e", to edit crontab, and a window is opened.
But after writing the changes, I press Save button but it seems not working, because when... (1 Reply)
I edit crontab with vi editor, i delete the lines i wanted, but i can't save!
i tried the :w, :wq, ZZ commands and it seems like vi is unfamiliar with it.
any suggestions? (3 Replies)
how does one save changes in crontab? i am using vi editor. Issued crontab -e command on the prompt. however not sure how to save changes. :wq doesnt work. any idea.... (10 Replies)
hi all
need your help.
I am wrting a script that will load data into the table.
then on another load will append the data into the existing table.
Regards
Ankit (1 Reply)
I'm trying to create a new crontab entry for a user on a debian box but whenever I do a crontab -e or crontab -u username -e then edit the crontab (with vim as my default editor) and :wq. I get the error message:
no crontab for username - using an empty one
crontab: no changes made to crontab... (18 Replies)
hi, every body. i have in trouble that how to load a dynamic library by hand.
for example, i know how to generate a dynamic library and how to link a dynamic library in makefile.
generate a dynamic library:
add -dy -G behind cc
link a dynamic library in makefile:
add -dy -Bdynamic behind cc... (0 Replies)