Crontab file located in,,, where?
Okay, I got a pretty big problem here, I'm not sure what to do exactly.
I kept trying, trying, restarting from scratch and everything until I was actually yelling and cussing and pulling my hair out. I'm not sure what to do, and hopefully one of you have had a similiar expierience and will be able to share your insight First off, I don't like crontab -e , actually, not to offend anyone but I hate it. Isn't there a way to edit your own crontab with the editor of your choice? I am use to editing my crontab file in root on my linux machine at home here using the command nano /etc/crontab Unfortunately, since I don't have root to this box I'm on... (professionally hosted) I can't do that. Is there any file where I could edit crontab using the editor of my choice, like... /home/jon/.crontab or something? -- This server is running on Redhat Linux 7.2 by the way, in case the file path may vary from distro to distro. Now, let me present my problem that made me ask this question to see if you could if anything, help me with this. You see, I'm not able to get a script to run, I've been adding it to webmin to execute at a certain time... then typeing date like a mad man in SSH waiting for it to go off...... it's time to execute goes by... and nothing ever seems to have happened. Spent 2 hours making the cronjob in webmin trying to get it to work to no avail. (Actually, I have gotton it to run once or twice... and then when I double-checked to see if it'd work within the next 5 minutes (to make sure I got it working and just not a 1 time thing... it didn't do a darn thing!!!... I'd then create a new cron entry and start over.....) Thats why I want to add the cron manually, but without crontab -e Here is a screenshot of the settings for crontab I have... you know.. the settings that don't execute when it's time to execute comes? http://www.picrack.com/002/avatars/crontab1.JPG I counted down for it to hit 5:00AM in the ssh console, typing "date" like I was crazy, and 5:00AM went by... 5:01,,, 5:02... 5:03... nothing ever happened, I didn't get "New mail" neither explaining any errors Any ideas on how I would be able to get this to work... or add the crontab manually WITHOUT using crontab -e? A tack of the code I'm trying to execute, not that it probably matters though since it runs fine if I ./ it from ssh Code:
#!/bin/bash |
If you don't like the default editor (probably it's vi on your system), you can set your own editor, by pointing at it's location using VISUAL environment variable.
|
What would I do for that?
export $visual = /usr/bin/nano ?? Thanks |
There are many ways to set environment variables, the usual one being:
name=value When a program executes, it gets its own environment. You can make it inherit variables from the shell the program is executed in. For example: name=value export name program When you use export name[=value], you don't usually put $ in front of the variable name, otherwise the name is replaced by the variable's content before the command is executed and you end up exporting a different variable. Put this in your ~/.bash_profile: export VISUAL=/usr/bin/nano The "profile" file is executed when the login shell starts, that is to say, when the system boots. The variable VISUAL is then copied to every shell that gets started and is (nearly) always visible. If you want to know where cron finds its files, I strongly suggest you to read some documentation. "man cron" and "man 1 crontab" give the basics. There also seems to be alternatives to cron. I base this assumption on a quick sf.net search. Regards Simon |
Wow thanks, was hunting for an answer when I heard the "new mail" notification sound, "Linux Questions Mailer: reply to ccrontab...."
thanks for the answer again!! I'll try it ! ;) [edit]Worked, thank you so much! |
All times are GMT -5. The time now is 04:04 AM. |