Programming :: Script Didn't Run In Cron ?
Sep 24, 2010I have a script put in cron.daily and edit the var/spool/cron/crontabs/root file with this text
Code:
I have a script put in cron.daily and edit the var/spool/cron/crontabs/root file with this text
Code:
I have a file:
979798707
787862348
766428634
I want to see if all the records in the file are present in the contents of the files of a particular directory.
Basically I want to say if grep doesn't return anything, then report.
For example in /tmp dir I have 4 files and flast 2 values (787862348 and 766428634) are present in the files of /tmp dir, but first one (979798707) is not. I want to echo that in a reporting file.
something like:
while read line
do
# if ! grep -rl $line /tmp
echo $line >> are_not_present
done < "myFile"
How do I achieve " if ! grep -rl $line /tmp"? That is, if the line is found by grep, then grep will print the output, but if grep does'nt find it, it will print nothing. How can I check if grep didn't find it (i.e. printed nothing)?
I recently noticed some of my one-liners with && and || didn't work as I expected so I googled for "bash && || pitfalls" and found this page [URL] It's probably my fault, but I still don't understand why it wouldn't work as I want it..... I don't even have the code anymore that wasn't working properly because I rewrote it using if ; then ; command ; fi
View 4 Replies View RelatedI make personal site with php on wamp. When uploaded it to my debian box I make some comments in index.php like
Code:
//include(realpath('inc/inc.php'));
echo realpath('inc/inc.php');
upload the changed php file, but when try to reload the site same errors stay there. There is some cache that I have to clear but I don't know where it is. In wamp I clear wamp mp* directory What cache I have to clear? Edit: It is not my browser. I use firefox and clear everything with several times ctrl+shift+del I even delete index.php but the same errors stay at the page:
Code:
Warning: include(inc/inc.php) [function.include]: failed to open stream: No such file or directory in /var/www/site/index.php on line 3 Warning: include() [function.include]: Failed opening 'inc/inc.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/site/index.php on line 3
A friend working in HPC environments commented me that he had an issue regarding the use of the malloc() function.What issue?He told me that he has had cases in where malloc() instead of returning a NULL pointer on failure, simply didn't change the original value of the pointer it was trying to use for allocation, thus forcing him to initialize pointers to be allocated with malloc() to NULL, so that he could be sure that if malloc() fails, a test for NULL would make sense.
View 12 Replies View RelatedI tried to write a cron job in Fedora13 as follows
#!/bin/bash
today='date +%d%m%Y'
cp /var/www/html/site1/module.txt /home/amitha/Desktop/backup/$today.module.txt
[code]....
I have an rsync script I wrote that I have tested and it works perfectly when I run it manually. Now I am working on a server setup script and I have gotten my setup script to create the rsync script in /etc/cron.hourly and restart crond. To spite the fact that the script is in /etc/cron.hourly and I have restarted crond, the script does not run. With that said, how can I script adding the rsync script to run hourly as a cron job?
View 9 Replies View RelatedI am executing the script.
with help of cron job but it is not executing in cron job.
i check owner and chmod and create the file and execute manually it is working fine but in cron job i set below
Crontab -e
8 14 * * * /home/tplinux/webapp/tpadminhost/collect_ejxml/ejrename.sh
wq!
after that wait till that time but script is giving message no such file in directory but same thing is excute manually it is running fine and found the files.
Below is my script details
file name ejrename.sh. code...
Can we use CRON to create new user accounts?
View 4 Replies View RelatedI am using Shell Script to run my Java program. I have written a Cron job to invoke Shell Script every day at 7pm. Cron job is running every day at 7pm ,but it is not invoking my shellscript and also I am not getting any error message. I am able to run same shell script from cmd propmt using bash, and also I am able to invoke the same script from mainframes Universal command job. Same ShellScript and Same cronjob is working fine in my Dev server. But in my QA server it is not working.
View 7 Replies View RelatedI have a script that that is supposed to send me an e-mail when a host is not responding to ping:
The script works fine when I execute it directly but when cron executes it, the ping error is never picked up by the script so the if statement is ignored.
Script programming question for the experts. I have written a bash script that works fine if I execute from the shell interactively. However, once I schedule it to be executed via cron, it just wouldn't work. I believe this has to do with cron running in a different environment than the one I am in when I putty in.
The bash shell script does refer to environment variables in the .cshrc file. I guess these aren't available to the cron? How can I load them into the script if I want them to be available to the cron locally within the script?
Can anyone tell me how i change the default domain name for cron?everything i cron runs it emails from and to user@com.com
this leaves me with a massive list of failed mails in postfix.i have mailto on my main crontab but i cant do it on all of them.
I have added some executable scripts to /etc/cron.daily but don't get the stdout/stderr output from them as mail (or anywhere else I have found). At least one of them is running (because I can see that it has added a file to the disk).
The peculiar thing is that I do get the output from /etc/cron.daily/0logwatch (part of the logwatch package) as an email each day.
The MAILTO line in /etc/crontab is "MAILTO=root" (unchanged from default). Same for /etc/anacrontab.
I do have an alias at the end of /etc/aliases which redirects root's mail to my own account, but this alias works fine for mail I send manually. (It also appears to work fine for the output from the file /etc/cron.daily/0logwatch.)
It seems that cron is not upgrading my Ubuntu 8.04 LTS Server, no GUI installed. I changed /etc/crontab and watched apt running:
Code:
ps -A | grep apt
showed it for a long time,
Code:
sudo tcpdump tcp
showed communication with canonical sites,
but:
Code:
top
did not show any apt using CPU
[code].....
I put in my cron entries to run my backup script which rsyncs my data to my 2nd drive, however on a hunch I checked my backup drive which mounts automatically via fstab and I realize it had not ran in a while. I checked cron and there were no entries for it. I got to wondering if I should ever be worried about a cron update coming down and over-writing my existing cron file with the backup entries in it to run.
View 2 Replies View RelatedI have set up a cron in /var/spool/cron/root
*/15 * * * * /usr/bin/phplist.sh
I can see in /var/log/cron that it is running every 15 minutes but it has no effect. It is not doing the commands in the bash script.
If I run /usr/bin/phplist.sh right in the shell it works great.
Is my vixie-cron broken? i have "0-59 * * * * root /usr/sbin/logrotate /etc/logrotate.conf" but it is not running in /etc/cron.d.
Code:
My root Vixie cron crontab is set to perform a system snapshot via fsarchiver: 0 0 * * * fsarchiver savefs -o -A /backups/p30_root.fsa /dev/sda2 /dev/sda3 The command itself works fine, generating about a 7G snapshot of my Suse server. I then wish to rsync this to a NAS I have located in another building: 0 3 * * * rsync -av -e ssh --delete /backups/ root{at address}:/DataVolume/os_backups/
(yes, I'm rsyncing as root. I absolutely loathe it, but I got thrown into an quasi-SA position with a ridiculous to-do list and no time to do it. I'm having to make things just work and then go back and try to improve them/learn how. I couldn't make it work in a non-root way quick enough, so for now I'm having to cron rsync jobs as root because of all the differing file permissions on this samba/MySql server. I set the NAS to only accepts ssh from the server IP, and we're behind a campus firewall... It's serious trial by fire.) The crontab also has rsync commands for the samba areas, our specialized chemistry software and affiliated MySQL databases............
I was seaching for a particular file (WAV) and using Applications>Places>Search for files resulted in finding none of the files I was supposed to haveHowever I then used Gnome Do and bingo there was one of them, then used the "reveal" option and there were all my files.Does anyone know why the ubuntu file search facility could not find them , but the Gnome Do could? By the way in the system search facility I sued *.wav and found other wav files, and then used DA* (DA being the first two letters of the file) and found all sorts of data labeled files etc, but none of the ones I was looking for. In 'Gnome Do' I typed 'DA' and there it was. I would really like to know the answer for future reference.
View 5 Replies View RelatedI have a dual boot with Win XP which I rarely use. I went into XP and used a program which became unresponsive, so I ALT CTRL DEL to get into Task manager and tried to end the process. Anyway the computer froze and I had to do a hard shutdown (with the power button). Now XP will only boot to Safe mode. If I try to go into normal mode it just goes to the XP screen before login and shows and endless bar timer. I am afraid to use my XP disc to repair XP as I might lose my Ubuntu partition. How do I safely fix XP?
View 4 Replies View RelatedI just upgraded from Ubuntu 10.10 to 11.04, and it doesn't seem like there is much diffrent, shouldnt I have a desktop like this:
when mine looks like this (the same it was for 10.10):
Do I have to enable something? I went to System>About Ubuntu. And I am running 11.04 so I'm not sure why it is like it is.
My computer is Eeepc 1201N. last time after I update my fedora13,It's network Manager can't show up Wireless even searching it. I want to log in my home wireless---IP:192.168.1.1
then I use ifconfig:
[sivanyeh@sivan ~]$ ifconfig
eth0 Link encap:Ethernet HWaddr E0:CB:4E:1C:2B:EA
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
[Code]....
Just installed CentOS 5.4, had no problems until the first time it tried to login, where the keyboard didn't work. There are bugs logged on both the CentOS site, and the Red Hat site, but nobody seems to have a definitive solution (other than buy a USB keyboard). Bearing in mind that the machine in question is not hooked up to a network (i.e. no internet updates), is there a way to resolve this issue?
View 6 Replies View RelatedI just installed Debian, after having some experience as a Ubuntu and Mint user. I'm not sure if this is normal, but my installation didn't include neither 'make' nor ' gcc', which I thought were very basic programs. They where in the cd though, I installed them through apt. I realized that they weren't there when I tried to install the drivers for a D Link DWA 525 wireless card. I was able to install the drivers on Ubuntu, but I can't do it on Debian. When I try to 'make' it, there is an error. I don't recall the exact error (since I have to reboot back and forth in order to get internet access, I won't post it right now).
View 4 Replies View RelatedI'm trying to troubleshoot my graphics card and the Graphic Card Theory article makes much use of sax2.
sax2 didn't get installed for either my 32bit or 64bit installations. I have intel graphics.
nor is there a Sax2.
Is this something new for 11.3?
I install 11.2 on AMD dual core 4200+ and 2G ramafter I enabled some effects on configure Desktop effects and when I pressed apply key the computer hang and when I restart it, it hang before login screen
View 7 Replies View RelatedWhat does it do?? Can i remove it??i tried apt-get remove dnsmasq. it didn't work
View 9 Replies View RelatedWhen is the 10.04 upgrade going to show on my update manager? I have been running the update manager since yesterday and the 10.04 upgrade hasn't shown up yet. It is still showing an upgrade to 8.10. I have been waiting to upgrade while exploring and using the 8.04 LTS Hardy. Now that it has been released it isn't showing on the update manager.
View 4 Replies View Relatedi was installing Ubuntu 10.04 on my laptop. But when the installer reach step 4, i cannot see my partitions on my computer that i has previously made. I already enter the manual partition editor sectin, but the list show that my harddisk has no parition no it. The weird thing is that i can normally access my partition on ubuntu live-cd's file browser, but it didn't appear on my installation wizard. Here is a screenshot of my desktop:
View 1 Replies View Related