I have a question about using crontab with /etc/crontab...
I had a cron job that I needed to run as root. At the time I thought that sticking it in /etc/crontab would be a good idea. However, I used the crontab command to edit /etc/crontab, which I guess is not standard procedure? Specifically, I configured /etc/crontab as my local user's crontab (i.e. sudo crontab /etc/crontab) then added my cron job as I would a local user crontab (i.e. sudo crontab -e).
Originally, my cron job looked like this:
30 * * * * root /my/batch/script &> /dev/null
After adding the new cron job I started seeing errors. Something to the effect of "can't find command root" or something similar. So I removed the 'root' user definition from the cron job and the job started running fine. However, because this is /etc/crontab, there are other system related cron jobs that have been defined to run under the root account (e.g. "17 * * * * root cd / && run-parts --report /etc/cron.hourly" runs as root, etc.). So these pre-existing system cron jobs, which up until now have been running smoothly, are now generating "can't find command root" errors. But I think that the system cron jobs _are_ successfully being run someplace because logrotate seems to be working.
So what I _think_ is happening is that /etc/crontab is being run twice: once as the system crontab, and once as my sudoed local user's crontab. When I run crontab -l I see nothing, but when I run sudo crontab -l I can see the contents of /etc/crontab. I am reluctant to delete my sudoed local user's crontab, because then in the process I would be deleting the system crontab, and I do not know how I should restore the system crontab's contents. (I am still not sure as to the most appropriate way to edit the system crontab).
How can I get out of this mess? I want /etc/crontab to go back to the way it was before--running _once_ as the system crontab. As for my new cron job, I'm willing to reconfigure it anywhere so long as I am still able to run it as root. Any ideas? (I am using Ubuntu 8.04 Server LTE)
I am using Linux 64 bit Redhat Linux. I am trying to setup simple crontab as follow...1. Edited crontab file using crontab -e2. Listed the file once to verify it using crontab -l. This will display as.. 18 5 * * 2-3 ksh $HOME/testScript.sh > $HOME/testscript.out3. Logged in a root and restarted cron deamon using "/etc/init.d/crond restart"As per my understanding now my testScript should start running at 5:18 am Thuesday
I have been having a small problem since I upgraded from Jaunty to Karmic, whenever I shutdown or restart, root password is required due to multiple users being logged-in.
I have run ck-list-sessions, however I can not trace where (or what) session 5 is.
Code:
Since I have MythTV installed and there was a similar bug, I tried the following solution without any success: [url].
On Launchpad there is the following thread on ureadahead:
[URL]
Is it sensible to remove "ureadahead" until this is fixed or is there no harm done? As a normal user ... (yes still I have /var in a separate partition, because I want to be on the safe side with my databases located in /var when reinstalling or upgrading the system ... - by the way: does this make sense or is it better to just have /home separate and use a backup of /var folders?) ... as a normal user I feel a bit lost with bugs like this. It would be nice to get some information somewhere. Something like:
"Don't worry, just wait for an update with a bugfix!" or "To avoid further problems just remove 'ureadahead' until it's fixed!"
I have the script below that I want to run when my sister logs into her account. But the problem is that `ifconfig up` or `ifconfig down` requires root privileges. How do I initiate the program when she logs in and have root the the runner of the program.
Code:
#!/bin/bash while true do elevenpm=`date +%s --date "2300"`
I am running Fedora 10 new install. lsdvd gives an error when trying to access the dvd. If I issue chmod 766 /dev/dvd then it works fine. Is there a way to set this a boot so access to the dvd does not require root password?
One of my machines running 10.04 recently began requiring the root password in order to carry out privileged operations in update-manager. I found this bug in launchpad. It's similar, but related to 10.10. If I create a root password, then I can use it to carry out privileged operations in update-manager, but I prefer not to add a root password just for this purpose.
I've been running 11.3 on a net book for several weeks and have not had this happen on that computer. On a different computer, which was upgraded from 11.2 to 11.3, now requires a root password to shut down the computer.
Since i installed KDE 4.* Whenever I go to shutdown, I get the shutdown dialogue, I hit shutdown, it logs me off, shows some text on shutdown screen, and then opens up the GUI again, bringing up a small window, where It asks for the root password, in order to shutdown. If i don't give it the root password, it goes to the login screen.
I cannot, any way, command line, GUI, or anything, shutdown without providing a root password.
If I use the command shutdown now, as root, it logs me off and goes through an endless cycle of logging off, and then asking for root to shut down, and not shutting down (All on the CLI), and everytime i give it the password, it cancels shutdown and goes back to the prompt. I eventually have to pull the battery to kill it in that case..
I have tried chmoding the shutdown scripts to make it work, it doesn't.
I have an HP Pavilion notebook running Ubuntu 9.04 and it has a lightscribe enabled DVD burner. Whenever I try to print a label using the LaCie Lightscribe Simple Labeler the program starts, I create the label but when I tell it to print I get an error message saying " Printing requires root privileges". I have tried starting the program with the icon, from a terminal using both "sudo" and "gksudo" and from a root terminal.
I am setting my cron to work. I am in the roo account/ So first I type as vi crontab -e. Then it ask me type "visual" for normal mode and do that then I type the following as below 1 * * * * root usr/local/testClient/runClient.sh>/usr/local/testClient/cron1.log and press esc type wq. Then I restart the cron service /etc/init.d/crond stop and /etc/init.d/crond start. Lastly when I type crontab -l it tells me no crontab for root.
I am trying to run rsnapshot from cron via root's crontab file (crontab -e). If I run rsnapshot from the command line with sudo it works perfectly, however, if I run it from cron:
Code: * * * * * /usr/bin/rsnapshot hourly >/tmp/crontab.out 2>/tmp/crontab.err This does not work. The crontab.err file shows:
I have set up my crontab and whilst Im logged in and it works (It runs my shell script), however when Im not logged in, the script does not run. Initially I set the time/date to 0 0 * * * (Midnight every day), as this did not work, I tested it with to 0 * * * * (every hour) whilst logged in and the script starts.
I use crontab -e to set it up under the root account..Im sure you dont have to be logged in for it to run?, but maybe im missing a step or just overdosing on Linux and need a holiday:-)
I downloaded a driver for my printer today and I opened it in the terminal. Then a window popped up saying "This opporation requires root (administrative) privileges. Please enter the administrative password below:" I typed in the same password that I use when authorizing the installation of programs from the Ubuntu Software Center and I tried it multiple times. Each time, it rejects the password. I even tried downloading something else from the software center, just to make sure the password was correct, but the system had no problem with the password when downloading from the software center. So, is my software center password different from my administrator password?
I have a second hard disk which has windows and C and D drives partitions. When I boot fedora 13, fedora automatically mounts them as 53 Gb Filessytem and 200 GB Filessytem. But when i try to browse to these filesystem, fedora ask me root password. How I can configure fedora so that it does not ask me root password and this change should be permanent ( surving computer shutdown and restart) ? I want these windows partitions to be reachable by me as the non-root user.Also given /dev/sdb (the windows disk) what is the command line to find out the filesytem path to which various paritions on /dev/sdb are mapped to?
When I setup crontab as a local user (settings shown below), then it can pop-up a xmessage windows * * * * * DISPLAY=:0.0 /usr/bin/xmessage -center "warning message here" but when I switch to root, and setup the same things in crontab, why it cannot pop-up a xmessage windows? Any special limitation for root to use crontab?
I'm running a fedora 14 file server with samba for a windows network. When I reboot my file server my samba share is no longer available. After a long search I found that if i run nmbd as root, the share is accessible again. I guess I can run nmbd everytime I reboot but I think something is wrong with my setup and it's one of those things that if I just ignore it will come back and bite me from behind
I have been having trouble setting up a daily backup script with cron. It would basically never worked. Searched the net for answers but didn't find anything. I finally figured it out !! When root crontab is edited the execute flag is removed from #/var/spool/cron/crontabs/root. I change it with #chmod a+x /var/spool/cron/crontabs/root and all is good.
I've just discovered that crontab is creating a new file in the root directory every time it executes a cronjob, and it doesn't erase over the old file so there are thousands of files in the root directory, they have the same name as the script file (appended with a numeral) but are all blank.here is what one of the cronjob's looks like[URL]
I write a little script that run top command and clear the output leaving only cpu ram and swap values. If i run the script manually everityng works fine but when i schedule the cript to run every 5 minutes from /etc/crontab all run fine but the output of the top command doesnt appear in the log :
I am scheduling a command for a specific time every day. Linux crontab format which I am using :- MIN HOUR DOM MON DOW CMD 30 08 10 06 * /home/mach/script.sh Some presetting is required?
How to break strings of command into multi-lines in crontab? e.g. Code: # the following is a very long a gruesome command to be run at 09:59 Monday to Friday. 59 09 * * 1-5 source $HOME/some-definitions; sh /usr/local/my/long/name/application/bin/hello $(date +\%Y\%m\%d) >>/var/log/my/long/name/application/log/hello.log
I have install RHEL5 and created normal user as "test". When I login as root user, I can run crontab command but when I login as test user, I can't run crontab command and throws error as "cron/test: Permission denied". how to enable crontab command for test user as well?
Having an odd problem running a mysqldump via crontab. I have the script running on other servers and they work fine, so not sure how to actually troubleshoot, but the script looks like the following;
If I run it as a cronjob as root, it finishes in a second and a 20k file is there. If I run it from the command line as root it does the backup (takes a few minutes) but does complete the backup and can be unzipped and read successfully.