Ubuntu :: Cron Command: Runs From CLI, But Not Auto?
Mar 10, 2010
I have a script that is basically a series of rsync commands called bkup_all.sh. This script is located in the /root/ dir.From the command line (su'd as root), I can run the script like this:/root/bkup_all.sh > /var/log/bkup/bkup_$(date +%Y%m%d).logThis excecutes perfectly, and all the rsync adn script output is saved in a log file in the intended destination. However, I want this command to run automatically, so again, su'd as root I enter:crontab -ethen enter the following:00 02 * * * /root/bkup_all.sh > /var/log/bkup/bkup_$(date +%Y%m%d).logI want the script to run each night at 2:00am.But, the script does not run. There is no log file generated and I do not see anything in the syslog or system messages to indicate an error.
View 2 Replies
ADVERTISEMENT
Dec 24, 2010
I have a cron job that I'm running once per minute.don't want to have the /var/log/crond.log get updated 60 times per hour. How can I suppress the logging of the job?I've tried adding the following to the cron line but they just get logged right along with it!
Code:
*/1 * * * * /path/to/script > /dev/null
or
[code]....
View 1 Replies
View Related
Jul 24, 2011
The problem is I need the php program to send member email confirmation which contains a confirm link. Run every min may still make the member wait. So I like to make it to run every 20 or 30 secs.
I don't want to put the code to send email on my sign up page as that's no good.
But I don't want to put a sleep 30 sec on my php script and going on loop. If it failed in the middle then it may wait abit to start.
What can be done to achieve my goal and what's the best way?
Making a php script to run as a daemon process? Is that possible and okay?
View 9 Replies
View Related
Apr 3, 2010
I am trying to write as bash script in order to have backup done by cron on the webhosting server. I want all backup runs to have incremental number in front of them. I came up with an idea to store incremental number of a backup in txt file on a server so when next one runs is can check the number in the file. However I am having terrible issues. My script:
[code]....
View 7 Replies
View Related
May 18, 2010
I have a cron job that runs a shell script. But it only runs the first line of that shell script and not the rest of the file. I'm a little stumped as to why. If I run the shell script manually, it runs and executes every single line as it should. I think I must need some additional syntax to make this run correctly?
Here is the crontab ...
Code:
root@kchlinux:~/macs# crontab -l
# m h dom mon dow command
[code]....
View 2 Replies
View Related
Mar 9, 2010
Within a VMWare ESX virtual machine, I am running CentOS 5.2. (Actually, it is kind of a virtual appliance to run CollabNet's Teamforge - which I have installed for a trial). I've been dabling with Linux for a year or so, but I know I have much to learn.
I'm attempting to run a cron job that runs a backup script at 11pm. It works great, but unfortunately it runs at 11:30 am.
I created the cron job using 'crontab -e', while logged in as root. My cron job line is : 0 23 * * 1,2,3,4,5 /etc/tjt_backup/collabnet_backup.sh
If I type 'date', I get the correct date/time in my timezone: Tue Mar 9 16:27:12 CST 2010
If I type 'clock', I also get the correct date/time: Tue 09 Mar 2010 04:26:57 PM CST -0.463330 seconds
(Although, it appears there is a little drift)
View 10 Replies
View Related
Jul 11, 2011
I have an Ubuntu server running Couch Potato, Sick Beard and Sabnzbdplus. Everything "works" pretty well in a sense that CP and SB push the NZB's to Sabnzbdplus, but Sab crashes regularly (haven't found the solution or the cause for this problem, so if you have some advice regarding that, it's welcome).To counter this problem (Sab crashing) I have a script written which checks if Sab is runnning and if it isn't start it:
Code:
bart@Pyro:~$ cat CheckSabRunning.sh
#!/bin/sh
[code]....
View 9 Replies
View Related
May 13, 2011
I explain in with an example:
Imagine you want to know which command is carried out when, after executing gnome-mouse-properties, you go to the Touchpad tab and click on "Enable mouse clicks with touchpad".
Another example:
Imagine you want to know the command that is executed when, after running gnome-appearance-properties, you go to the "Visual Effects" tab and click on None.
I've had a look via gnome-system-log in all the log files of the left with no success. Perhaps the commands that run when one changes things in the GUI menus are logged in some other file. Or perhaps they are not stored in any log. In this case there is probably some terminal command to know it, or some program for this.
I think that know that no xorg.conf is used by default this is something to have into account.
View 3 Replies
View Related
Mar 3, 2011
I am trying to execute an awk script which is called by a shell script. The result is that it always responds with << ^ invalid char ' ' in expression >>
As I do not have command line access, I use a php script as go-around.
On the command line,
Code:
awk --version
gives the following output:
Code:
Command: awk --version
GNU Awk 3.1.3
[Code].....
View 4 Replies
View Related
Oct 13, 2010
I have a launcher for Quake that essentially runs a shell scripts that runs quakespasm with certain options. Is there a way to add it to AWN?
View 6 Replies
View Related
Jul 6, 2010
I run XBMC media center software which is built on a minimal Ubuntu install. I was running a version built on Karmic and I had the following line in my /etc/init.d/rc.local and it always ran without a hitch:
Code:
mount -t cifs -o file_mode=0777,dir_mode=0777 //192.168.1.20/disk7/xbmc_thumbs/Thumbnails /home/kevin/.xbmc/userdata/Thumbnails
Recently, I upgraded to a version built on Lucid and now that fails to create the mount on boot up. Here is the entire contents of the file:
Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides: rc.local
# Required-Start: $remote_fs $syslog $all
[code]....
View 1 Replies
View Related
Dec 27, 2010
I'd like to know which command i should run from the terminal to know which file system (ext3, ext4, etc...) my Ubuntu runs on.
View 2 Replies
View Related
Oct 9, 2010
I am setting up a cron job on my DD-WRT router to execute a WOL command, and would like to know if what I have is correct.
Format:
Execute @ 12:00 on Wed, Thur, Fri, Sat every month/Yr
0 12 * * 2345 root /usr/sbin/wol -i 192.168.1.255 00:00:00:00:00:00
View 3 Replies
View Related
Mar 28, 2011
I was just curious if cron had to be enabled before use. i have a crontab, and the cron daemon is running, but the command isn't executing...
View 9 Replies
View Related
Jun 24, 2010
I have a simple script. When I run it as cron job. I jot email saying:/bin/sh: line 1: test.tmp: command not found.Even I took first line out, I got the same error.The current shell I have is /bin/tcsh.
View 4 Replies
View Related
Jan 4, 2010
I want my server to automatically shutdown at 23:59 and startup at 8:00. The startup is handled through by bios but the shutdown is to be managed through cron. I thought I had this working, I actually swear I had it working because I thought the uptime command showed the appropriate uptime. I happened to be up and was streaming a movie from my server when at the time it should've shutdown it actually just restarted. If I run the shutdown -h now command by itself it works well but the scheduled command just restarts the server. Here is the what is shown when I enter crontab -e.
View 9 Replies
View Related
May 29, 2011
I have a test socket on a server. If I connect to it using telnet, I get exactly the response I expect. So I know the socket works, and the script on the server works:
Code:
my-desktop:~$ telnet 192.168.1.1 3333
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
RAM: 90 % Free ( 2793 M free, 3082 M total)
Connection closed by foreign host. And if I script it, I get almost the same response from Telnet, but still a valid response from the socket. So I know that my script works:
[Code].....
View 2 Replies
View Related
May 31, 2010
I have the following shell:
export PATH=/u01/app/oracle/product/10.2.0/db_2/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
ftp -u -v -n -i > /bk01/exports/FTP_OUTPUT.LOG <<EOF
open 197.0.0.78
user orabackup orabackup
cd /media/disco/BK_Oracle
bin
put FILE00001.LOG
put FILE00001.DMP
quit
EOF
Executing the shell from command line, the output is:
Connected to 197.0.0.78.
220 Bienvenido al servicio FTP del servidor backup.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
331 Please specify the password.
230 Login successful.
250 Directory successfully changed.
200 Switching to Binary mode.
local: EXPO_APOT10G_20100531.LOG remote: EXPO_APOT10G_20100531.LOG 227 Entering Passive Mode (197,0,0,78,200,162) 150 Ok to send data. 226 File receive OK. 127498 bytes sent in 0.0022 seconds (5.7e+04 Kbytes/s)
local: EXPO_APOT10G_20100531.DMP remote: EXPO_APOT10G_20100531.DMP
227 Entering Passive Mode (197,0,0,78,175,141) 150 Ok to send data. 226 File receive OK. 458190848 bytes sent in 6.1 seconds (7.3e+04 Kbytes/s)
221 Goodbye.
Executing the shell from cron, the output is:
Connected to 197.0.0.78 (197.0.0.7.
220 Bienvenido al servicio FTP del servidor backup.
331 Please specify the password.
230 Login successful.
250 Directory successfully changed.
200 Switching to Binary mode.
local: EXPO_APOT10G_20100531.LOG remote: EXPO_APOT10G_20100531.LOG
local: EXPO_APOT10G_20100531.DMP remote: EXPO_APOT10G_20100531.DMP
221 Goodbye.
Why from cron the output no show the statistics in red ...?
View 2 Replies
View Related
Feb 3, 2011
I'm writing a script that performs backups from partitions on remote servers. I used to do this with ssh, but that seems to be somewhat slow, so I switched to netcat.I start a listener on the receiving server (which runs the script) like this:netcat -l -p 7000 | dd of=imagefile &and then I make the remote and start a dd piped to netcat. This works quite well started manually and the listener is waiting in the background. However, when I have cron run the same script to automate it, the netcat listener is not started, probably because the "&" thing does not work (or there is something with the piping that behaves differently then)
View 7 Replies
View Related
Jul 1, 2011
I am frustrated by running a script on the Fedora 14 computer as a cron job. I paste the code:
Code:
#!/bin/bash
#a backup script to copy data from sda to sdc
ROOTVOL=`blkid -U ea210a08-6212-4dc8-be1c-23fce3b965bc`
[code]....
So when I run this as root, for example:
Code:
# /root/myscript
the result is what I expect:
Code:
Jul 1 13:41:16 svn root: ADMIN: Executing backup-svn
Jul 1 13:41:16 svn root: using blkid ea210a08-6212-4dc8-be1c-23fce3b965bc as /dev/mapper/vg_svn_backup-lv_root
[code]....
View 3 Replies
View Related
Feb 18, 2010
so i have a few shell scripts that execute wonderfully when i type them at the command line but they fail when they are run from cron.
for example, if i run a script from command line that contains
Code:
shopt -s nullglob
to prevent problems with for f in *.mp4 type loops, it works fine from terminal command line but when called from cron, it gives an error->
Code:
/home/centralsqwall/Videos/videochecker.sh: 91: shopt: not found
a couple other random errors as well...
so there is some difference in the shell from cron and the terminal?
i'm running ubuntu 9.10, #!/bin/bash
what are the commands i should be using to echo my environment or simulate cron environment from the terminal?
View 3 Replies
View Related
Jun 5, 2010
I have a very simple gawk script to add commas to numbers to make them more readable:
It works perfectly from the command line, but when run from cron it doesn't add the commas.
View 2 Replies
View Related
Mar 31, 2010
I am using SLES10 and i checked with command crontab -l and when i compared it with the cron.d/daily/monthly/hourly , all they are different. is there any single command that list out all the cronjobs that exist under the system.
View 3 Replies
View Related
Feb 22, 2010
I've Ubuntu installed on a SD card running on my Eee PC 1000H and have to type in, everytime after startup, this line:
Code:
sudo hdparm -B 1 -S 1 /dev/sda
to turn off the noisy HDD. How can I auto execute this command?! System>Startup Applications didn't work
View 3 Replies
View Related
May 3, 2010
My .jar file needs and uses some files in the same directory it's in (everything, including the jar was unzipped into said directory). It runs perfectly when I do java -jar file.jar in the command line, but there's trouble when I double-click the file when running from the file system manager. I've tried a custom command under properties ie java -jar, but the problem is that the .jar file doesn't seem to be able to use any of the files in the same directory. When running, the jar can't find any of the files that it needs.
View 5 Replies
View Related
Jul 13, 2010
I use a SLES-machine (should be similar to opensuse I guess) and ad AIX-machine and got the following error:
Every time a none-root user runs an "at"-command on the linux machine, there is an error written into the errorreport of the AIX-machine. the error is the following: <82>Jul 12 22:32:09 linux-hostname atd[10754]: PAM audit_log_user_message() failed: Operation not permitted
I already checked the files /etc/at.deny (exists with users listed like "alias, backup, bin, ..." but not the user that causes the error-message) and /etc/at.allow (which does not exist but is not necessary, as far as I could read from the internet).
View 3 Replies
View Related
Apr 29, 2011
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.
View 1 Replies
View Related
Dec 17, 2010
I am using Ubuntu as the client machine operating system. I have a start up program to connect to a Windows terminal Server. I am needing assistance in how I can force the client to logoff if the terminal connection is terminated for any reason. This is more of a security issue as we do not want the students using the computer to access the loacl machine at all. The program works great on boot, but it shows the home screen when terminated.
View 1 Replies
View Related
Dec 20, 2010
In dealing with the Nvidia Powermizer, I have to set it to "Prefer Maximum Power" mode from adaptive mode in order that I can avoid laggy in using my GUI. However, it doesn't save this setting so I have to manually tweak it everytime........
Someone on the web taught me to use the following command line:
nvidia-settings -a [gpu:0]/GPUPowerMizerMode=1
running it in the terminal it will set to the mode I want.
Would I be able to make my computer run the above command in terminal everytime it starts? I tried to put the command in the start up applications and it seems not working.
View 5 Replies
View Related
Feb 25, 2010
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].....
View 2 Replies
View Related