Debian :: Executing Scripts From Cron ?
Oct 1, 2009
I am adding the following scripts to cron via crontab -e (as user)
Quote:
The first one is to record tv. I've added dev/null 2>&1 at the end. No too clear why but without it, it records only a few seconds.
The second script is (as you should already noticed) to turn off my computer at 6:25 am. It doesn't work (with or without dev/null 2>&1). I am surely forgetting something important. Could you please tell me what is it?
View 6 Replies
ADVERTISEMENT
Jun 2, 2010
I'm trying to add several cron jobs. I have a folder (/etc/cron.myapp) with several subfolders in it (30minute, 3minute, daily, hourly). Each of these folders contains a script.Runnng/usr/bin/run-parts /etc/cron.myapp/3minute/will execute the contents of that folder.I have tried adding the following entries to /etc/crontab with no luck, and nothing is showing up in /var/log/cron
*/3 * * * * /usr/bin/run-parts /etc/cron.myapp/3minute/
*/3 * * * * /usr/bin/run-parts /etc/cron.myapp/3minute
*/3 * * * * root /usr/bin/run-parts /etc/cron.myapp/3minute/
[code]....
View 3 Replies
View Related
Jun 5, 2010
so sorry about this seemingly silly cron question. I know a lot are asked, and are usually just environment related.Anyway, I wrote a very simple PHP script to mount my external drive to a specific location as soon as it's switched on.The script works great when run.What's strange, is that it runs in cron and generates a log file, but for someone reason doesn't mount the drive when cron runs itI added in the full path to EVERYTHING in the script, and I'm calling it with the full path from crontab, but it doesn't mount my drive when run from cron.I've tried running the individual commands on the cmd, and it all works.
View 9 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
Mar 2, 2011
I own a CentOS 5 VPS. I typed crontab -e, and then I added the following line to automatically have my server backup mysql
0 * * * * mysqldump -u root -p password --all-databases | gzip > /home/dbbackup/database_`date '+%m-%d-%Y_%H'`.sql.gz
When I go in and look, it doesn't place any files in /home/dbbackup. When I run
mysqldump -u root -p password --all-databases | gzip > /home/dbbackup/database_`date '+%m-%d-%Y_%H'`.sql.gz
View 3 Replies
View Related
Nov 6, 2009
I wanted to use cron to play a media file at a certain time (i.e. use it as an alarm clock). However it seems to do nothing. The contents of my crontab is:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * command to be executed
5 11 * * * env DISPLAY=:0.0 /usr/bin/totem /path_to_file
View 2 Replies
View Related
Sep 17, 2015
Here is my script to create a sitemap with wget:
Code: Select all#!/bin/sh
wget --spider --recursive --no-verbose --output-file=wgetlog.txt http://http://www.cyberciti.biz/
sed -n "s@.+ URL:([^ ]+) .+@1@p" wgetlog.txt | sed "s@&@&@" > sedlog.txt
I named it Nixcraft.sh and in /Home I had made it executable via the file properties. In the terminal I entered:
Code: Select all./Nixcraft
and got
Code: Select allbash: ./Nixcraft: No such file or directory
View 14 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
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 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
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
May 30, 2011
How can one have commands in cron? I do not know much but do know that there is something called cron. I read the manpage[quote=Cron Debian Man page]cron - daemon to execute scheduled commands (Vixie Cron)[/quote] and it says to make files in /var/spool/cron/crontabsWhile I went to /var/spool/cron/crontabs I did not find anything there. I just want to tell cron that it runs $sudo aptitude autoclean at some time in the background. Is this possible? If yes, then how ?
View 5 Replies
View Related
Mar 14, 2010
I know that Redhat have a log in /var/log/cron , I can check the cron job log here , I would like to ask where is the log in Debian ?
View 1 Replies
View Related
Feb 9, 2011
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:
View 2 Replies
View Related
Jun 27, 2015
I have a ts3.desktop file in my /usr/share/applications folder that I want to run on system boot. I have typed the following commands which don't work
Code: Select allcrontab -e
Then in the editor, I typed the following line at the bottom of file. I also made the necessary carriage return after this line.
Code: Select all@reboot gtk-launch ts3 /usr/share/applications
Then I pressed ctrl+o to save it.
After I put these commands in, I did the following command to troubleshooting this issue, see below.
Code: Select all$ crontab -l
no crontab for server
$ps -ef | grep cron | grep -v grep
root     532   1  0 21:35 ?         00:00:00 /usr/sbin/cron -f
But after I reboot and nothing happens, the application doesn't start.
View 1 Replies
View Related
Jan 24, 2010
Theres this php script which is to be run every 10 minutes :- php -q /var/www/extra/cron/cron.php
View 3 Replies
View Related
Mar 1, 2010
I've been using debian for sometime but I've never trusted in automated upgrade on my servers so my question is: Is this safe in cron and how often should I run it (everyday, once a week)?
apt-get -y update && apt-get -y upgrade
Of course I have stable version installed.
View 4 Replies
View Related
Sep 6, 2010
I have an ftp script that will run fine manually when logged in as root. I set the root's crontab to run this file and it won't run. The script run fines from the command line with either "./ftpcall.sh" or "sh ftpcall.sh" but doesn't run at all in the cron. Permissions are obviously set to execute as it runs fine from shell.
View 3 Replies
View Related
Mar 9, 2011
Is it possible to shutdown or to halt by means of cron ? this crontab entry is doing nothing: 45 3 * * * halt
View 2 Replies
View Related
Jun 3, 2010
I have made a shell script that is ran every 5 minutes (using crontab) that does the following:(please disregard the '.' in ht.tp .. I'm under 15 post...can't post URLs yet ) Code: #!/bin/bashwget -q --read-timeout=0.0 --wait=5 --tries=5 -O /var/log/dynamicDNS.data ht.tp://someURLecho "[$(date)] $(cat /var/log/dynamicDNS.data)" >>/var/log/dynamicDNS.logrm /var/log/dynamicDNS.data >/dev/nullexit 0 (this script might look pretty bad but hey, it's my first one!)hat works perfectly! Though, I need to have this "cron" run from startup (boot) without the need to open a terminal and leave it open.I understand I can use runlevels to start a program from boot but that will have it run only once.
View 5 Replies
View Related
Apr 6, 2011
Cron doesn't run jobs in Debian 64 (testing). It gives error
Code:
Apr 6 15:31:01 debian64 /USR/SBIN/CRON[5454]: (CRON)
Error (grandchild #5455 failed with exit status 1)
and does not run the script.
View 5 Replies
View Related
Jun 21, 2011
I have running Debian on a QNAP device and it like's run well. But todat I saw that the default cron job seems a little bit strange [ -x /.sr/.ib/.hp5/.axlifetime ] && [ -d /.ar/.ib/.hp5 ] && find /.ar/.ib/.hp5/.-type f -cmin +$(/.sr/.ib/.hp5/.axlifetime) “delete
I think is sould be [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete
How is't possble?
View 5 Replies
View Related
Dec 1, 2010
I'm testing on a VM version in debian LAMP with CGI / FastCGI enabled. My goal is to run a PHP script via cron, unfortunately I can not run it .. I don't understand if I'm using a wrong path for the execution of API CGI or I get lost in the syntax ...
here is my cron:
H # m Sun mon dow command
10 * * * * * / etc/php5/cgi / var / www / import / import.php? Mode = P
where to retrieve the execution path and how to troubleshoot the cron ?
View 1 Replies
View Related
Jul 7, 2010
Just curious if this is possible. What I want to do is setup a rsync job to backup my laptop to my personal file server(same LAN), but I want it do do this at 3AM while I'm sleeping. However I always close my laptop lid when I'm done using it which puts the laptop into suspend mode since that's how I configured my power options in gnome. Since I don't want to leave my laptop powered up all the time, I was wondering if it is possible to have a cron job scheduled that will wake the laptop up(out of suspend mode) and run my script/backup job, all without opening the lid of the laptop, and then put it back into suspend mode when it's done. Is this possible, and is it as easy as scheduling a cron job or is there some other scripting/configuration/trickery that I need to do to accomplish this?
Also, my laptop's BIOS has the option to power on at a scheduled time if needed, but I'm not sure if that would work with it being suspended(hibernation is not an option since my entire HD is encrypted with LUKS and I would have to be present to enter the password to boot the system.).
View 7 Replies
View Related
Aug 16, 2010
I have a XEN DomU VM running Lenny and set up using debootstrap. I also have the TimeWentBackwards issue sorted using: [URL]. The problem is that my cron jobs just don't run. I've set up a cron job that simply echoes a date string to a file as a tester but it's not running. I've tried it under the root crontab, in /etc/crontab and set up in /etc/cron.daily. Is there something I'm missing?
View 1 Replies
View Related
Oct 15, 2010
Due to a disk crash I've had to rebuild my Debian Lenny system. For some reason I can't get my cron-fired backup scripts to run. They will run manually.
It looks like crond is not running. If I try to start it, here's what I get:
Pancho:/home/lloyd# /etc/init.d/cron start
Starting periodic command scheduler: crond failed!
MORE INFO:
lloyd@Pancho:~$ /etc/init.d/cron start
Starting periodic command scheduler: crond/etc/init.d/cron: line 54: start-stop-daemon: command not found
failed!
[Code].....
Clearly the problem failure to find start-stop-daemon is not the problem and I'm still in the dark.
View 2 Replies
View Related
Apr 6, 2010
I just turn of the services, but there is something wrong about it...How to locate the problem? Maybe its some script in /etc/cron.*? Ive tried running them "manually" but nothing special happened. Is there a log for cron-scripts (or what are they callled)?The kernel panic says something like this: "Kernel panic not syncing, fatal exception in interupt, iwl4965 - irq_tasklet".So it seems to be in the iwl4965 driver, but also strange as it is connected to ana/cron.
It hapens very unregularly sometimes just a minute after starting ana/cron, sometimes it can go longer. It wasnt always like this, first it just happened when I played Warcraft on wine and i thought that was the cause (it might not even be the same problem, but i think so), but then it happened at other times also, so I fiddeled around with the startup services and found that disabling cron and anacron (its about the same thing I figure) keeps the trouble away. Well, its not a big problem, but I just wanted to see what the problem is, Also, is the cron-script doing anything of importance
View 2 Replies
View Related
Sep 20, 2010
I've been upgrading a bunch of our servers from sarge to etch and then to lenny, on two of these servers, cron has broken, cronjobs will not run. On another two (that have no significant differences from the others) cron is unaffected I created a simple job to run while I was testing
*/1 * * * * root /usr/local/mailtest-1 in the script is echo test mail from busted server | mail -s "test mail from your busted server" [URL]. and that runs fine if I run it manually, I've added it into /etc/crontab and crontab -e but haven't got a single mail from it. The cron service is running
I tried apt-get remove --purge and then a re-install but it doesn't seem to have worked. All the logs have stopped rotating as well so I'm starting to think that maybe it's not a fault with cron but with some other service that it depends on. However, I've not been able to figure out what that might be.
View 5 Replies
View Related
Mar 25, 2010
The system crontab (/etc/crontab) uses the same format, except that the username for the command is specified after the time and date fields and before the command.
[code]...
Every hour, I get an e-mail complaining about the first line of the crontab:
[code]...
I get the same complaint from the other entries: It looks to me as if cron, or anacron, is trying to execute the user (root) as a command. Predictably, the shell doesn't like it, so barfs and triggers an e-mail about it. Why is this not doing what the man page says it should do? The 2nd problem I believe is related to exim, not cron. The e-mails I'm getting above are being bounced from my ISP because they are directed to root@myisp.com, rather than my regular e-mail address. When the message bounces, it bounces to my regular e-mail address. In /etc/aliases, I have root: [URL]... and in etc/email-addresses I have root: [URL]... Adding the entry to /etc/email-addresses allowed the bounce to find me because the sender's address is [URL]... but how can I get cron to send these messages to me in the first place, instead of root?
View 11 Replies
View Related