Ubuntu :: Running "at" Command Within A Cronjob ?

Mar 3, 2011

I ran into a problem when wanting to execute the "at" command from within a cron job.

Essentially, I have a daily crontab job that is launched at "the wrong time" (middle of night). I want to delay the execution of an import script until around 07:00. Editing the crontab is not an option (shared environment).

So I figured: Use the "at" command from within my script that is triggered (indirectly) by crontab: Code: #!/bin/bash at -f ./redo_import.sh -v 07:00 I know my script is started with `pwd` pointing at that same directory.

Running the "at" command directly from terminal works.

Running the script file above from terminal works.

But... when triggered from within crontab it does not work. I get exit code "1" from "at".

I searched man pages for "at" without much success. No mention of meaning of exit codes.

How to locate the sources of the "at" command.

View 3 Replies


ADVERTISEMENT

Debian Multimedia :: Cronjob No Longer Running

Aug 4, 2015

I am running Debian 8 with the Xfce Desktop Environment.

A few weeks ago I created a cronjob which randomly changed my desktop wallpaper every two minutes. Here is that cronjob:

Code: Select all*/2 * * * * DISPLAY=:0 /home/alessandro/bin/random_wallpaper

Today, however, this cronjob stopped working. (The random_wallpaper script still works as intended.) The only changes I made to my system were

1) I modified my compton configuration settings; and
2) I installed a new display manager, SLiM.

I'm not sure why any of these changes would prevent my cronjob from running though.

View 0 Replies View Related

General :: Pass Parameters To A Shell Script Running As Cronjob?

Dec 7, 2010

I am new to bash scripting (not programming in general).

I am writing a bash script that will run a Python script I have written.

I want to be able to do the following:

Pass parameters to the bash script via the cronjob (so I can have two cron jobs) one to be run with parameter 'foobar', and the other 'foo'
switch based on the parameter passed to the bash script (by switching, I mean an if/else based on the paramter passed to the bash script).

View 3 Replies View Related

General :: Setting Up A Cronjob / Error Saying Php Command Not Found?

Apr 5, 2011

i have a site where I need to run a couple of php scripts every day..therefore I was thinking to setup a cronjob to do this. Unfortunately I get a whole bunch of errors trying to do so.

I can execute the php scripts via a command line without problem, one example would be

php /home/site/domains/stie.be/public_html/admin/cronjobs/cronjob_daily_ssh.php

however when i enter this command as such in a cronjob I get an error saying php command not found ( or something similar , doing this out of memory)

I tried to add the full path to the php command, but also this doenst work

the best workaround I found was to execute the php scripts with a lynx - dump command, but obviously this is not the right way.

View 7 Replies View Related

Ubuntu :: Cronjob Stops After Several Seconds?

Sep 13, 2010

I want to use a cronjob to start a script running streamripper to record radioshows when I'm not at home. I'm running 10.04 server 32 bit.

I've setup a cronjob via Webmin to start the recording. It runs the following script:

Code:
ORDNER=`date +%Y"_"%m"_"%d"-"%H"_"%M"(FM4)"` # 'ORDNER' means Folder and creates a folder with time/date to save the stream
streamripper http://mp3stream1.apasf.apa.at:8000/ -d /mnt/Samsung/Radio/$ORDNER --xs_padding=2000:500 -a -q -s

[Code]....

Is there any logfile or way to see why the script is killed or what stops the recording? When executing the script manually the recording runs just fine until I kill the process.

View 2 Replies View Related

Ubuntu :: Send A Libnotify From A Cronjob?

Feb 24, 2011

Is it possible to send a libnotify from a cronjob? I'd like a notify message when my daily backup is done. When I run my script from terminal everything is working fine, when (ana)cron runs it, it works as well but the notify is surpressed. My Guess was, that it happens because the jobs are run as root. Nevertheless is it possible to get a notification message?

View 4 Replies View Related

Ubuntu :: Cronjob Not Starting Backupscript?

Apr 18, 2011

I wrote a little backupscript wich is working fine if i start it from the shell manualy. But I'm not able to let it start automaticaly via cron in ubuntu 10.10.

Here the bashscript:

#!/bin/sh
####################################
#
#
#
####################################

[Code]......

View 1 Replies View Related

Ubuntu :: Changing Fb Background Cronjob?

Jun 6, 2011

I'm trying to change my desktop background on my fluxbox desktop every minute using cronjob to a random picture within my Pictures folderthis is crontab -e file;

Code:
# Edit this file to introduce tasks to be run by cron.
#

[code]....

View 2 Replies View Related

Ubuntu :: Cronjob Results Filling Up / Directory?

Feb 22, 2011

Some of my cronjobs are filling up files in my / directory. How do I make this stop? One of my cron jobs uses wget:[URL].. The bexcb0.php file writes a file and then echos a result if it is sucsesfull. These echo results are being put into bexcb0.php files in my /root folder and are piling up.

My / folder is filling up with files bexcb0.php etc bexcb0.php bexcb0.php.1 bexcb0.php.2 bexcb0.php.3 bexcb0.php.4 bexcb0.php.5 etc How do I make this stop? If I just remove the echo will they stop writing to the / folder?

View 1 Replies View Related

Ubuntu :: Root Cronjob Not Working On Schedule

Jun 27, 2011

I have added "@daily shutdown -r now" to my root crontab (sudo crontab -e) but it does not seem to ever run. When I look at the chron log using webmin I can see that it tried to run and there was no error. Also when I run it manually using webmin the system reboots fine. I also tried using reboot -f in the crontab instead and that also worked when manually run but not on schedule. The reason I know it didn't run is on webmin it shows the system uptime. This is the output of the chron log:

Code:
Jun 26 21:17:02 GrantLaptop CRON[3467]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Jun 26 22:17:01 GrantLaptop CRON[3873]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Jun 26 23:17:01 GrantLaptop CRON[4269]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Jun 27 00:00:01 GrantLaptop CRON[4530]: (root) CMD (shutdown -r now)
Jun 27 00:17:01 GrantLaptop CRON[4630]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Jun 27 01:17:01 GrantLaptop CRON[5005]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Jun 27 02:17:01 GrantLaptop CRON[5416]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)

View 5 Replies View Related

General :: How To Set Cronjob In /etc/crontab

Apr 10, 2011

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?

View 2 Replies View Related

Server :: Run Cronjob Once Every Three Months?

Apr 30, 2010

I am trying to run the following only once every three months but looks like it runs every day. I edited crontab -e and added the following:

Code:

0 23 * jul,oct,jan,apr * /path/to/script > /var/log/script.log 2>&1

View 2 Replies View Related

Ubuntu Installation :: Command For Running CD At Boot

Apr 28, 2010

How do you actually install ubuntu? I cant figure it out, its nothing like windows! I download the unetbootin to make a boot usb drive.. I did that but when it boots it ask goes blue with a thing flash default. Then it asks me to press tab, when I do that it comes with a cmd. What should a write? If I click esc on the keyboard it brings a cmd line. If I write like E:dir it says kernel invalid. What is a cmd that runs the cd on a boot for ubuntu. How hard is to install it??

View 9 Replies View Related

Ubuntu :: What's The Command For Running Natilis As Root

May 7, 2010

What's the command for running natilis as root? What about my natilis spelling?

View 2 Replies View Related

Ubuntu :: Running Cups From Command Line?

Dec 23, 2010

I need some help desperately, and would appreciate a quick response. To begin, here's the output from 'uname -a' for the machine I'm using: Linux ubuntu 2.6.35-23-generic #41-Ubuntu SMP Wed Nov 24 11:55:36 UTC 2010 x86_64 GNU/Linux

Now, when I start my computer, cupsd is running:

[Code]...

View 2 Replies View Related

Ubuntu :: Running Command After Lock Screen?

Jan 15, 2011

So I have a script that runs from 'Startup Applications'. That works fine. However, I also want it to run after I unlock a locked screen such as after suspend or a screensaver. I have mod3+t as a shortcut to it, but it would be nice if I could get it to run automatically.

View 2 Replies View Related

Ubuntu :: Running Application In Command Line?

Feb 12, 2011

I have a application in
/xxx/xxx/xxx/app
I need to type a long path each time, if I want to use it. I want to use it just type 'app'. How to do? Whatever I'm stay in any path.

View 2 Replies View Related

Ubuntu :: Command For Running Natilis As Root?

May 10, 2011

What's the command for running natilis as root? What about my natilis spelling?

View 1 Replies View Related

Ubuntu :: Running A Command In Terminal Upon Start Up?

May 14, 2011

I am relatively new to linux but i need to run a command in the terminal so i can prevent wireless power save from happening every time i switch to battery power. I dont really want to go into the terminal every time i switch to battery mode so i want to be able to launch this command upon start up:

Code:
sudo iwconfig wlan0 power off

View 2 Replies View Related

General :: Cronjob / Run The Files Everyday At 11.00 Pm?

Apr 23, 2010

I need to run the files everyday at 11.00 pm (Monday to Friday).

How would I put on cronjob? I have files ready.

View 5 Replies View Related

General :: Configure Cronjob To Run Every 45 Days

Nov 19, 2010

we have requirement like we need to run the sql script, which needs to be executed for every 45 days.

View 1 Replies View Related

General :: Pop Up Message From Cronjob Run Script?

Dec 22, 2010

I'm working on a bash script that will be run regularly via a cronjob. As there is no easy way for the user to see if it's running in the background, I'd like a have some kind of pop up window what say's something like "Process started" and "Process finished" when it's complete. Ive read though some similar threads and came across xmessage. It kind of does what I want, with the exception of:-Id like the message Process started to stay up for the whole process, but it looks like the script wont continue until the xmessage window is closed. I cant get any xmessages to appear when the script is run from a cronjob. It only appears if I run the script manually from a terminal window. Which is no good for me. If anyone has any suggestions that would be great and just to add, it's doesn't have to be xmessage, any text box would do. I'm working with Redhat 4 and 5, if that makes a difference. Chuck Norris destroyed the periodic table, because he only recognises the element of surprise.

View 2 Replies View Related

General :: Return Value Of Tftp Is Always Zero In Cronjob?

May 15, 2010

I have called an script in cronjob named get_mac.sh as follows:

#!/bin/sh
MAC=`ifconfig eth0 |sed -n 1p|awk '{print $5}'|awk -F : '{print $1$2$3$4$5$6}'`
ARG_FILE="/etc/asterisk/scripts/server.params"

[code]....

View 1 Replies View Related

Server :: Way To Setup Cronjob For Configuration?

May 27, 2010

I'm trying to setup a cronjob that needs to run every 40 minutes between 10am and 3.30pm.I generally used cronjob for simple configuration, but now I'm a bit lost.There is a way to setup cronjob for that configuration? (better if all in one line of code, not multilines).

View 4 Replies View Related

Server :: Email Myself Output Of Cronjob?

May 10, 2010

I have the following Cron job scheduled on my Postfix mail server: Code: 00 18 * * * /usr/bin/clamscan -r --remove /home/.This is just running a scan on my entire /home/ directory and removing any infected files it finds. My question is since this is being ran at 6pm via Cron, how can I get the results of this job emailed to me via text? Does anyone recommend a command I can add to the end which will dump the results into a file or email and send it to a specific email address? This server is my company Postfix MTA for everyone.

View 14 Replies View Related

Software :: Cronjob And Feh / When Its Run Via Cron It Fails?

Aug 21, 2010

I wrote a small bash script to use feh to change my background every time its called. I use a cron job to have it execute every 5 minutes.

When I run the script manually it works perfectly, however for some reason when its run via cron it fails. I can see that it is executing but it seems to error for some reason.

Its kind of a drag to have a working script that when run as a cron job suddenly no longer works.

View 7 Replies View Related

Software :: Not Able To Open Web Browser With Cronjob

Jan 4, 2010

I have to run one testcase which opens a web_browser on Linux machine. When a run with cygwin it works but I can't always keep it open. I want to schedule a cronjob to run this testcase.

View 1 Replies View Related

Ubuntu :: CronJob - Alarm Clock Setup With Snooze Function

Feb 4, 2011

I need to set up an alarm to start at 7:30am and run every 5 seconds until I stop it. How would I acheive this in cron tab?

View 2 Replies View Related

Ubuntu :: Running A Command In The Alt+F2 Prompt Possible In Bash Scripts?

Jan 5, 2010

Is running a command in the Alt+F2 prompt possible in a bash script?I need this for a launcher for gnome-shell.For it I have written a little script to check if the process gnome-shell is alive and act accordingly.The script works fine, I just don't know how to write "debugexit" to the Alt+F2 prompt, as that is the only decent way I have found to shut gnome-shell down and going back to gdm desktop smoothly.

View 1 Replies View Related

Ubuntu :: Running A Command System Wide To Fix RGBA?

Feb 22, 2010

I'm trying to run a command that will let me run some programs. If I run the command in a terminal, then I can launch the programs from it fine, but not from anywhere except that terminal. This is the command that makes things work:Code:export GTK_RGBA_APPS=allbut:exe:checkgmail:swiftfox:firefoxThis command disables RGBA for the programs listed, which seem to have problems with it. I hoped I could use this command to somehow apply it system wide permanently. I've tried adding it /etc/rc.local and rebooting, but it doesn't work.Is there a way of doing this? Or am I barking up the wrong tree entirely? Is there a better way to disable RGBA for certain programs?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved