Linux cron job fails to execute part of script which works in shell
location: linuxexchange.com - date: January 1, 1970
I'm having a problem with a script that writes to a log file during a backup procedure. Tested perfectly when called from the root shell, but fails when run from the cron demon.
Backup is done over a series of partitions and the on-site admin will rotate the drives in the top dock weekly. In order to know where the most recent backup is located I've included the following lines
sudo hdparm -I /dev/sdb | grep 'Model Number'
sudo hdparm -I /dev/sdb | grep 'Serial Number'
I've tried this with a >> /batch/backup.log and without.
When the bash script is run from the command line, it works beautifully. But when the crontab calls the script the output from these lines is blank.
crontab entry: 00 00 * * * /batch/backup.bat >> /batch/backup.log
I have no idea why other than the possibility that cron can't handle the pipe or the grep or something.
I have isolated the lines in a test.bat but they remain blank.
The backup script uses the hdparm to spin down the drive at the end
cron job and boot command
location: linuxquestions.com - date: November 6, 2006
Can anyone supply detailed and full information on how to run webalizer every hour?
I expect the command is
59 * * * * /usr/bin/webalizer
but then what?
Also I need to start /opt/wwwroot/bin/ httpd on boot.
Cron job from linux box to windows box
location: linuxquestions.com - date: July 3, 2003
Cpanel creates a backup for me everynight and stores it to the backup directory.
I have a tape drive in the windows server and am using samba. I am still learning linux and was wondering how I can setup a cron job to copy those backups to the windows box everynight.
How to get last runned cron job details in linux?
location: linuxexchange.com - date: June 21, 2012
I want to get details of last runned cron job in my machine . Because if the cron is interrupted due to some internal problems . I want to rerun the cron job .
Note : I didn't have root user privilege .
Running cron job on linux every 6 hours
location: linuxexchange.com - date: July 19, 2012
How can I run command every six hours every day? Tried this not working :
/6 * * * * * mycommand
run cron job only when machine is idle (linux)
location: linuxexchange.com - date: January 20, 2013
How can I run a cron job(bash script) only when CPU idle >50%?
I can get cpu idle from TOP
top -b -d 00.10 -n 3 |grep ^Cpu
Cpu(s): 0.3%us, 0.3%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
my current setup is:
0,15,30,45 * * * * /usr/bin/php /home/user/batchprocess.php
# I could use a bash script here to call PHP, if it is a good solution.
And I have the PHP script check for CPU idle:
// wait for CPU idle
$cpu_stat = exec('top -b -d 00.10 -n 3 |grep ^Cpu');
$tmp = stristr($cpu_stat,'%id',TRUE);
$cpuidle = trim(substr($tmp,strrpos($tmp,',')+1));
// do actual processing here
The problem with my current method is it starts the program regardless of CPU utilization. And the while loop running TOP feels not efficient. I wish it only starts when CPU idle>50
Some additional info:
Centos 6.2, PHP5.3
I have a few EC2 instances that never shuts down, so I want to utilize their proces
cron job for backup the database in linux/php
location: linuxexchange.com - date: December 24, 2012
Am new to linux cron job, i am using mysql DB, my database name finaldb, i want to take this database every one hour,
I have folder called dailbackup, in this i have folder by date wise,in this each folder i have backup mysql db file
name like final_db_9.sql (this backup taken at morning 9 am), final_db_13.sql(this backup taken at noon 1pm, like that ,
this process at present am doing manually , is it possible to make it automation , any ideas, suggestions ,
Cron Job in Amazon Linux EC2
location: linuxexchange.com - date: January 1, 1970
I searched on google how to setup a cronjob on amazon linux ami, but I found no way to do it. Anybody know any tutorial or how to do it? I'm still learning ... thanks
Linux & Duel Boot
location: linux.com - date: April 21, 2011
I am building a desktop & would like to duel boot with Linuz & Windows XP. I need someone with Linux savy to tell me if the components I have is adequate for Linux. Power Supply: Corsair 650 W. Motherboard: Gigabyte GA-MA785GT-UD3H. Memory: Corsair XMS3 (2X2 GB) DDR3 1333. CPU: AMD Athlon II x4 640. HDD 2x Seagate barracuda 7200.12 500 GB. Case: Cooler Master Gladiator 600.
I plan to load each OS onto it's own HDD & wifh seperate internet security for each, in other words, two seperate operating systems. I know the components are OK for XP, what I don't know, are they OK for Linus.
Also, which Linux OS would be recomended?
Cron Job Error Show the Following 24: bad minute
location: linuxquestions.com - date: September 14, 2013
Currently running Ubuntu 12.04 LTS 64-bit with 3.5.0-28-generic for the kernel. This is all as a guest in VirtualBox 4.2.18.
I'm trying to setup a cronjob thru crontab under root account and continue to get the following error when trying to save it.
The goal of the cronjob is to run apt-get commands to update the system without me having to do anything.
Here is the error message
Page: 1 2 3 4 5 6 7 8 9 10