CRON Job not saving
I created a CRON job in the "/etc/cron.hourly" directory. Just to practice creating a CROn job I created a small BASH script that shows memory information and disk information:
Code:
#!/bin/bash Code:
"CRONTEST" |
Quote:
Since you're not the systems administrator, based on what you've posted, you really should ask them for assistance with doing things that modify system files. |
In order to run CRON jobs hourly I would have to put them in the hourly directory right?
|
Quote:
If you're NOT the administrator you can't write to that directory, and you will have to schedule your OWN jobs in your OWN cron to run every hour. AGAIN, if you're not the administrator, you need to ASK THEM for assistance with these things. AGAIN: You have been asking about cron numerous times in the past; apply what you've been told here: https://www.linuxquestions.org/quest...er-4175608264/ https://www.linuxquestions.org/quest...hs-4175597217/ |
Ok, I understand now. So I logged out of SUDO and tried to create a CRON job in my own directory. I gave me the same error.Also, I'm not a systems administrator.
|
Quote:
Either case, if it is verbiage or the way each are expressing their selves we should not get overly hung up on the definition of sudo. Instead what you should remember for this and for all cases are that when you are doing work to your system which affects the system at large, and especially if you are affecting the startup, or periodic system actions, along with working out of directories that are not your home, you should be aware that most of all those actions require superuser level privileges, however you end up obtaining them. Therefore when you create or edit cron jobs in the future, you should remember that you'll always need to have superuser privileges. EDIT: Although I see the concept of running a cron as a regular user is discussed in TB0ne's post. I've never done that, and probably never would try it. To me cron is used at the system level to run periodic jobs. Yes it probably can be used by a regular user, however if you have that form of maintenance requirement, I have to wonder why and what in the system is not protecting other users similarly. I.e. if it is your system alone, then I'd do it for the entire system, and thus make it as root. If it is a multi-user system, then I'd recommend to the administrator of the system that they add this for all users. |
Quote:
Quote:
|
Try the following
Code:
cd Perhaps a subfolder is a better place Code:
mkdir cronjobs Code:
ls -l CRONTEST Code:
pwd Code:
crontab -e Code:
01 * * * * /path/to/CRONTEST |
@MadeInGermany.....I tried everything you posted, in my HOME directory. It all worked just fine until I got to "crontab -e". It stated that Im not allowed to use this program (crontab).
@TB0ne...... I was in my HOME directory and wasn't sudo. I will work with them to be able to do this. |
Quote:
If you are experimenting with cron, do it as a user. A crontab file has 6 possible entries (man 5 crontab). Code:
field allowed values You would do better reading the documentation on how to use cron than trying to alter your system. |
I didn't think I was altering the system in any way, I thought I was just showing information. I found out the reason why I could not create CRON jobs is because the password for the user 'oracle' is expired. Once the password is reset I will be able to do this.
|
All times are GMT -5. The time now is 09:05 PM. |