Ubuntu :: Bash Script Works Partially In Cron?
Sep 24, 2010
I have a script that pops up a jpg file several times a day as a reminder. The script is called up by crontab and it works perfectly.The issue is that I want the script to also perform a system "beep" in addition to popping up the jpg file. When I test it on the command line everything works but when I run it in cron the jpg file pops up but the beep doesn't beep. I'm thinking the problem is in the "echo -e \a" part. I must be missing something.Here is my script:
#!/bin/bash
echo -e \a
sleep01; echo -e \a
[code]....
View 8 Replies
ADVERTISEMENT
Feb 17, 2011
I'm really running into a wall trying to figure this out. I have a Bash script and narrowed down the one command that doesn't seem to work via cron and it's my pgp decrypting line. Works fine if I run the command via terminal but if I run it via cron it doesn't output anything.crontab -e shows the cronjob and it runs, creates the log file with no output. Is there maybe something I need to run as well? Permissions look set, unless the cron is running as a different user(was under the assumption if it showed up under crontab while logged into that user, then it would run as that user.
View 14 Replies
View Related
Jun 4, 2010
My recent install of 11.2/KDE on a laptop suffers from a strange misbehaviour of the compose key (I have declared the Windows and Menu keys as Compose). It appears that two different sets of composing sequences are active, depending on the application.
I have to explain that I use a lot of unusual characters on a regular basis and therefore keep adding more sequences to /usr/share/X11/locale/en_US.UTF-8/Compose. I have even redeclared a couple of predefined sequences to values that are more useful for me. All these work fine, for example in a terminal window (konsole or xterm) or in konqueror, or even in OpenOffice.
However, other applictions seam only able to handle the default set of Compose sequences. This applies, for example, to Firefox or Gimp. It does not matter whether they are invoked from the command line or from a desktop icon. I tried both the Firefox shipped with OpenSuse, and a download from mozilla.org: Same result.
I tried to delete other Compose files from /usr/share/X11/locale/* but it did not help. I wonder where the default rules are actually found after deleting all the Compose files, even if (for some reason) the locales have changed in these applications.
View 2 Replies
View Related
May 9, 2010
Since installing Lucid LYNX LTS on my Netbook. (See: [URL] [#136]). Via USB, I can connect my iPhone 3GS. It gives me two simultaneous choices:
Open F-Spot and Open Rythmbox.
In addition, I can also "Open / Browse Folder". As such, I can view / import photos and videos made on the phone, as well as video PODCASTS. I can also play my music files
What I cannot do:
1) Play / find my purchased audiobooks [decryption not supported]
2) Locate the mp4 videos / movies (NOT encrypted) that I transferred to the phone via iTunes on my MacBook.
3) Send a file via bluetooth to the phone [the Indicator Applet does allow me go go as far as select the file. It gets to the point of "connecting" then "unknown error occurred"
I cannot sync the addressbook, calendar, or notes on the iPhone with my netbook. I have the following libraries installed:
ifuse
libmobiledevice-utils
libmobiledevice0
libplist++1
libplist1
libusbmuxd1
python-imobildevice
usbmuxd
NOTA BENE: This phone is NOT jail-broken.
View 2 Replies
View Related
Aug 28, 2010
I've made a bash script to do scp a file from another server and tested it successfully by executing it manually. However, when I scheduled it by cron, I received a mail from root saying permission denied.
The script is at:
It's supposed to secure copy a file from a remote host to:
The script's content is (No need to supply password as I've done the ssh-keygen thing):
Code:
From what I can make out of the mail, it appears that it has problem saving it to the /home/backup directory.
View 7 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
Feb 19, 2010
I've got a bash script that uses rsync via SSH to back up data from a remote webserver.
This script works fine when I run it myself but when it runs as a cron job I get the following error:
Code:
2010/02/20 08:15:01 [6786] Unexpected remote arg: user@www.server.com:~/www
2010/02/20 08:15:01 [6786] rsync error: syntax or usage error (code 1) at main.c(1219)
[code]....
View 9 Replies
View Related
Nov 13, 2010
Code:
#!/bin/sh
chown -Rc steven:users "/home/steven"
I have more lines in the script but each line does the same error. This is run in a cron job but it always returns.
Code:
chown: cannot access `/home/steven
': No such file or directory
But it is a valid directory I have even tried adding an / and even a space on the end and still same error.
View 7 Replies
View Related
May 4, 2011
I have a personal server and a dynamic IP address, so I wrote a script to check the currently assigned IP address and compare it to the one stored in a file from the last check, and visit the update URL if it's different.
View 4 Replies
View Related
Mar 25, 2010
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 Related
Jul 11, 2011
I'm trying to get cron to run a bash script every 15 minutes to change my desktop background
running crontab -e I added
Code:
*/15 * * * * sh /home/ME/Documents/scripts/background.sh
(at first i didnt have the sh before the path of the script but read somewhere i needed that) But it doesnt seem to be running my script works fine if ran straight from the terminal so Dont think thats the problem.
View 9 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
Jan 8, 2009
I 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.
View 4 Replies
View Related
Mar 18, 2010
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?
View 1 Replies
View Related
Apr 20, 2011
I have script which does file locking via flock and then writing it's pid into that file. It perfectly works being run by hand in terminal, running under cron on Debian, but somehow fails being run under cron on Centos 5.6. Script part and straced outputs are below.
bash code:
#setting lock
mylog "setting lockfile $LOCKFILE"
exec 200<> $LOCKFILE
[code]....
View 4 Replies
View Related
Jul 16, 2010
I want to write the date & time and a text string to a file from crontab.The following line works fine in the CL:echo $(/bin/date +"%F %T")" Some text" >> /home/me/foo.txtI installed in crontab and no text appears in the file that it is redirected to.The crontab entry looks like:* * * * * echo $(/bin/date +"%F %T")" Some text" >> /home/me/foo.txtTried a version to just write to stdout....* * * * * echo $(/bin/date +"%F %T")" Some text"No date, time or text appears at the command line
View 5 Replies
View Related
Aug 21, 2010
I don't quite understand how pipes work in bash. I know that it takes an output from one command as the input in another command. What an output is I can get because it's what the command prints out to the screen. But how do I know what input a command will take? Here is an example I thought would work:
Which gem | rm
Unfortunately it didn't.
Which gem prints out "/usr/bin/gem" so that must be the output right? I thought that was given to rm so it would be "rm /usr/bin/gem" but I was wrong. How do I know what input a command takes?
View 4 Replies
View Related
Oct 8, 2010
I have a PGP script that for whatever reason if I let linux's cron run it automatically, it sends out the final email with attachment with a blank file. If I come in and run in manually everything works fine and the file is populated in the file. So the only real difference is that i'm running it manually through cron, rather than letting cron run it at a set time.Below is a sumary of my script.
Code:
#! /bin/bash
#PGP Decryption Bash Script
[code]...
View 6 Replies
View Related
Jul 16, 2010
I'm writing a Bash script to take IPTC keywords from a text file and write them, via Exiv2, to several (first batch is 100) JPEG files in a single directory. The script has one while loop inside another while loop, both terminated, but I'm pretty sure that's not my problem. I think it's how I'm incrementing the "counter" variable, although it could also be the method of parsing the text lines from the file (using cut with delimiters that have worked fine in simpler scripts).
Here's the code as I've worked it up to this point.
Code:
And yes, "keywords" checks out in Crimson Editor, Emacs GUI and nano as an ASCII file with UNIX line endings. No issues on that score.
Feeding each line consecutively into a terminal (excepting the exiv2 command) works fine: each variable echoes with the part of the text line used as a variable value as it should, even when the b variable is incremented the quick&dirty way (up arrow three commands and hit enter).
Running the above script in eval mode (sh -x) stalls after setting the b variable to one and reading in the first line of text. I'd like to know why. I'd also like some advice on another reliable method of parsing the read-in lines.
View 14 Replies
View Related
Feb 16, 2011
Writing script to create backup of file by adding datetime to file name. Basically test for file presence if there, cp with datetime then rm original cp works fine from command line but get cannot stat `full path to file': No such file or directory
Code:
Here are the errors: cp: cannot stat `~/html/CVP_dadamail/.dada_files/.logs/errors.txt': No such file or directory rm: cannot remove `...': No such file or directory
The for statement is a placeholder as I have same file to backup out of several directories. using "bash -x scriptname" -OR- inserting echos, I can see I've constructed the strings properly. Believing it might be related to the hidden directories, I tried setting the shopt "glob" options to no avail.
Ultimately I'll add the other directories to the for loop and then run this from a cron job, so if you see potential pitfalls knowing I'm headed in that direction...believe construct would be
Code:
View 4 Replies
View Related
Oct 18, 2010
I had to make for work a collectd based network monitoring system which displays data for each server in a fullscreen conky on different compiz viewports. I have to switch viewports automatically when the machine isn't operated (sorta screensaver) and also if i had to call attention in the case something bad happens, autoswitching should stop and the relevant viewport be showed up.This requires an interface to talk dynamically to the WM, which i've implemented in bash with support of the widely available "wmctrl" program.
Code:
http://paste2.org/p/1177045
Code:
[code]...
View 8 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
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
Sep 19, 2010
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 Related
Jul 16, 2010
I have a remote server which has been working perfectly for about 1 year. It is in a secure location and used for serving a local web-app, and we remote administer it through an OpenVPN tunnel, and previously a Hamachi tunnel.It has in the last few days become partially unresponsive. What I mean is that I can ping it fine through the VPN, and I can SSH into the box, but when I try to run some commands, it seems to freeze partway through, and I get the output interrupted and a blinking cursor. I have also tried to access the web-app through the VPN and while the page header in the browser changes to the correct page name, the actual page does not load.A reboot does not seem to have cleared the problem, although I cannot be certain at this moment that the reboot command actually completed, or froze partway through
View 4 Replies
View Related
Nov 5, 2010
I'm running an English language Ubuntu 10.10 and after a fresh installation, I installed support for the Spanish language via Administration> Language Support. After unistalling that language it still keeps ramdonly appearing in some parts of the system. For example in System>Administration>Configuracion del cortafuegos (Firewall configuration) (!!!!). Another example is in the terminal. The biggest part of it is in English, however all the lines that show, for example when installing a package, are in Spanish
View 1 Replies
View Related
Mar 11, 2010
I'm actually using both system, Ubuntu 9.04 and Windows XP, I got an HDD Western Digital (WD4000YR) with 400GB capacity, I have this weird problem (confirmed on other MoBo's with the same problem):
Power on the PC > In BIOS, disk capacity is 150GB > Start on Linux > In linux, disk capacity is correctly display: 400GB > Reboot > Start on Windows > disk capacity is correctly display: 400GB
BUT IF
Power on the PC > In BIOS, disk capacity is 150GB > Start on WINDOWS > in Windows, disk capacity is incorrectly display: 150GB
Linux its the solution to my problems, if I start on linux and then i REBOOT to windows works fine, but it doesn't if I turn OFF the PC. I need both systems due to incompatible software. My question is: Why in LINUX the disk works fine and if I reboot the disk continues doing just fine? What linux do that windows doesn't on the disk thing? I though maybe adding a line in windows option of the GRUB or something.
What I tried:
Fill with zeros using the WD tool, resign and format in Windows
Fill with zeros using the WD tool, resign and format in Linux
Format in Windows
Format in Linux
I have to say that the disk works great, when I do that (start linux then reboot to windows) the disk works just great, I had large movie files in there and works. So maybe the disk its not.
View 6 Replies
View Related
Oct 13, 2010
I just tried to upgrade from 10.04 to 10.10, but since update-manager did not show the upgrade button (for some reason it did not know that there was a new release?), I tried upgrading using sudo do-release-upgrade.This only worked partially though, and now when I run lsb_release -a it says that I am running maverick, but when I try to run update-manager, it says that the upgrade was only completed partially, and it suggests that I try to finish the upgrade, but it then gets the following error:"An upgrade from "maverick" to "lucid" is not supported with this tool"
View 7 Replies
View Related
Jan 29, 2011
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.)
View 3 Replies
View Related
Feb 16, 2010
I 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.
View 3 Replies
View Related