I have a quick question involving crontab and a script I want to run with it. The script generates and sends an email to group members who are on-call for a given day, but when you run it this appears'Run This Script?' The script will run when you enter 'y' or 'yes' and then press enter.
I'm trying to give that input via another script which runs the first one and then waits for the prompt to input a 'y'.How can I make a script which waits for a prompt and then gives it input?
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
is it possible disabling a crontab job without deleting the crontab description entry (by crontab -e)?I could also accept to change the entry itself. Now it's:0 0 * * 0-6 /home/me/cron/script.csh
In my latest Debian I noticed that apt-get install does not, as I expected, stop to ask for confirmation before starting the actual download/install process.it directly carries on with the operation, which is obviously very annoying when, as I usually do, you first want to see what packages are needed (and how heavy the download) and then you want to decide whether to proceed or not.The man pages, as I correctly remembered, talk about a -y option intended to bypass confirmation requests, which means that the default behaviour should be the opposite.I tried also on a Ubuntu 10.10 with the same result.
I notice that one of the functions I can make a keyboard shortcut for in KDE is Log Out Without Confirmation. This might show a lack of imagination, but when might I want to do that?
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 have installed an application manager(monitoring application) on my linux server. Now, i need to have backup schedule for my application. The application itself has executive file to backup database.But when i put this file in my crontab to schedule the backup program it wont run!50 09 * * * root /opt/ME/AppManager9/bin/BackupMysqlDB.sh
I have a DNS server at an old companies place and that box will be losing it's IP. The whois record for the domain goes to godaddy which has 2 'A' records; ns.domain.com ns2.domain.com which point to the current 2 DNS servers. Now if I have a new server up and running and the zones copied over, do I just need to change the 'A' location for ns.domain.com to this new IP? I remember back in the day you had to 'register' the nameserver with the registrar, etc.I haven't touched this stuff in a while, and before I go and change the IP of the nameserver, want to make sure all is in check.
When shutting down 10.04 you are forced to deal with a confirmation window. In previous releases it was possible to switch this off, e.g. right click shutdown button or using gconf-editor. I can't remove this feature bug in 10.04.
Since I upgraded to 10.04 Lucid the Shut Down applet puts up a window titled "Shut Down" that has two buttons "Cancel" and "Shut Down". In 9.04 this confirmation window didn't appear. How can I make "Shut Down" skip the confirmation and shut down directly? I've looked around for a preference item about that a couple of times but didn't find it.
I keep seeing stuff that says "right-click on the shutdown icon, select Properties" and so on.Well, I've just upgraded (should I say "upgraded"? It was a fresh reinstall really, not an Upgrade through the Update Manager) to 10.10, and right-clicking on the shutdown icon does not produce a "Properties" option.I get About, Remove From Panel, and Lock To Panel... none of which are helpful.So, it's been asked before and I'm gonna ask it again: How do I remove the annoying confirmation when I want to shut down Ubuntu?
I want to synchronize sets of files (e.g. from or to flash memory). rsync is powerful, but --delete option is dangerous. Anyone know whether there's a way to do --delete interactively, i.e. get rsync or some near equivalent to ask (y/n, in a console window) before deleting?
If I configure a crontab like below.12 3 12 4 4 cat /etc/passwd I know that the cat command will get executed at the configured time. But where will the output of that command go?If it is something like below, then out put will be routed to /tmp/file1.12 3 12 4 4 cat /etc/passwd > /tmp/file1
I know crontab -e sets a cronjob in /var/spool/cron but how do I set a cronjob to run from /etc/crontab? Is there a command used for this or would I have to manually edit a certain file?
I want to set up a crontab so that from my machine {which is 192.168.0.99}whatever I create in a directory called "/information" {suppose some texts files}will be copied to 192.168.0.100 and 192.168.0.101's machine "/readinfo" directory at 5.30 pm. everyday."/readinfo" is directory which is accessible by all users on that machines {192.168.0.100 & 192.168.0.101}is this crontab right?30 5 * * * /bin/cp -rf /information/* 192.168.0.100:/readinfo30 5 * * * /bin/cp -rf /information/* 192.168.0.101:/readinfoI guess first these 100 and 101 machines should allow me {99} ssh connection without passowrd.
I just reinstalled Ubuntu, but before that I made a list of all the programs that needed to reinstall too. the thing is that it keeps asking me for confirmation before installing every app, and I want it not to... so I can get some sleep while it sets up everything.How do I do this? maybe using the "yes" command, but how?
I'd like to get the 13.0 "synchronized to <time server>, stratum <stratum>" messages back on 13.1.
- On 13.0, running ntpd 4.2.4p8, reassuring messages appeared in /var/log/messages like "synchronized to 211.233.84.186, stratum 2". - On 13.1, running ntpd 4.2.6p1, there are no messages in /var/log/messages to confirm that time is being synchronised.
rc.ntpd on both starts ntpd with the same options. /etc/ntp.conf is identical on both, a "get it working and then make it secure" version: Code: cat /etc/ntp.conf | grep -E -v '^$|^#' cat /etc/ntp.conf | grep -E -v '^$|^#' server in.pool.ntp.org server asia.pool.ntp.org server 127.127.1.0 fudge 127.127.1.0 stratum 10 driftfile /etc/ntp/drift
According to Linux Home Networking, synchronization can be checked using ntpq -p. This shows synchronization is working. I would prefer to see that confirmation in /var/log/messages without having to run a command manually to check it. How to get the old messages back?
My laptop's clock (Acer Extensa 5220) seems to be slow. I've corrected it 5 minutes forward last week and now have just corrected minute forward again. Is there a program [apart from time servers] to correct clock properly, for example, by shifting it a bit every hour? Is there already a program to put it to crontab or I should hack up a script? Or I should check more things?
I have found that HW clock is right, but system time is slow: about a second each 2.1 hours. root@vi-notebook:~# dmesg | egrep 'clock|unstable' [ 0.103785] Switching to clocksource tsc [ 0.265274] Marking TSC unstable due to TSC halts in idle [ 0.265514] Switching to clocksource acpi_pm [ 1.321408] rtc_cmos 00:09: setting system clock to 2010-10-30 00:10:48 UTC (1288397448) Is placing "hwlock --hctosys" to crontab a right thing?
Im new to linux, using ubuntu 10.04. I have been playing around with crontab and have no problems scheduling a job which runs a script file containing the following command:
However, when I try to do the following in the script file nothing happens..
Similarly the following doesnt do anything either:
As you can see two of the lines are commented out. However, both commented out commands are still running. I get emails stating that the RALUS agent restarted (another mystery since it's supposed to go to dev null according to the line above), and I can see that the memmon script is also running daily. Am I missing a step? Some other place I should be looking? Commenting out lines in your crontab is pretty much a no-brainer, so I appear to have less than no brain as this is a mystery to me.
I'm running Ubuntu server 8.04.3 with eBox on a Dell GX280. I want to power off my box automatically every night, so as root I added a crontab entry "05 1 * * * /sbin/shutdown -P now". The command runs on schedule but most days the PC goes into a coma instead of powering off. It doesn't respond to key presses or mouse movement or Ctrl-Alt-Delete, I have to push its power button to complete the shutdown. I have tried a variety of alternatives such as "/sbin/shutdown -h" and "runlevel 0", they all behave the same way