Cron is a job scheduler that allows users to run commands periodically.

learn more… | top users | synonyms (1)

2
votes
1answer
289 views

Suddenly lost all cronjobs

All of a sudden my cron jobs don't work any more. When I type crontab -e I am presented an empty file in the editor /tmp/crontab.3fMYGi/crontab And by empty I mean that not even this standard ...
3
votes
3answers
737 views

Is setting a higher nice level for a process an effective way to reduce its impact on system load/CPU time?

I have an rsync cron job which is pushing the server load and triggering monitor alerts. If I set the job to be run with a high nice level, would that effectively reduce the impact it has on system ...
0
votes
2answers
277 views

How to add the logs to a crontab with time stamp [duplicate]

In crontab, I scheduled a daily backup script. Now when the cron executes the script the status are logged to a log file as shown below. 0 0 * * * /home/backup.sh > ...
3
votes
1answer
131 views

How to switch tty with a script / cronjob

Is it possible to switch the current tty/vt with the help of a bash script or a cronjob? I only know the physical keyboard input "Ctrl-Alt-Fx". I would like to show two virtual desktops at different ...
3
votes
2answers
217 views

Bash if script is called from terminal echo stdout to terminal, if from cron do not echo output

I would like to have a service watchdog script echo the status to the screen if called like ./watchdog.sh but if it is run by cron, there is no need to echo output. What is the proper method? Where ...
0
votes
1answer
258 views

Mysterious automated emails

I remember messing around with crontab and setting up email capabilities on a server many months back, and now all of a sudden I'm getting the following email: EMAIL HEADER: from: root ...
3
votes
3answers
71 views

Where to put system cronjobs?

If I need a cronjob that runs at system level (i.e. not specific for a certain user) how do you suggest me to create it? running crontab -e as root appending it to /etc/crontab creating a file ...
0
votes
1answer
710 views

Create cron as a apache user and run as root user

I am creating this cron as apache user and want to run this cron as root, below is my code snippet: # Create a cron job to restart apache cron_file="/etc/cron.d/restart_apache_crontab" cron_job="*/1 ...
0
votes
1answer
96 views

Why don't these cron jobs run?

Here is my crontab: # rsnapshot jobs 0 9-21 * * * /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf hourly 52 22 * * * /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf daily 42 22 ...
-1
votes
2answers
220 views

Shell script passing null value while executed as cron job [closed]

We are using the below commands to get pagesapce values and I need to check percent of used pagespace. For this I have used the below code, but when running this script it's passing a null value into ...
0
votes
0answers
57 views

CronTab on OpenShift

I have a robot witch updates a particular page on Wikipedia every 2 hours. I copied it to OpenShift and made a Crontab on my own computer witch connects to OpenShift via ssh and run the robot. How can ...
0
votes
1answer
206 views

How to rebuild /etc/cron.d on CentOS?

I installed an RPM on a CentOS machine that was supposed to merge its own files contained in a /etc/cron.d structure with the current /etc/cron.d. However it replaced the current contents. I believe ...
0
votes
2answers
1k views

create a cronjob to run php script

I've created a cronjob in Xubuntu to run a PHP script in every 5 minutes. I did it as follows. I entered the following command: $ crontab -e Then entered the following: */5 * * * * /usr/bin/php ...
11
votes
4answers
13k views

How do I completely silence a cronjob to /dev/null/?

On my Ubuntu-Desktop and on my debian-server I have a script which needs to be executed each minute (a script that calls the minute-tic of my space online browsergame). The problem is that on ...
0
votes
1answer
5k views

How to use Crontab for a java file in linux

How can I use Crontab in Linux specifically for a Java program? I want to run a MIS Script. How can I crontab it and what should the path be?
1
vote
1answer
75 views

Mailing output of cron

I have this script which I run once a month, and I want to get the output sent to my email. If I run it manually like so, then the standard output is sent to my email. ./monthly_mail.sh | mail -s ...
3
votes
4answers
213 views

Does cron jobs per se represent a significant burden on a modern system?

I'd like to run a pretty simple script (is there a dir with name x in dir y if so move it to dir z–and x will only be there about once a day) every 15 seconds or so (one minute divided into 4*15 ...
0
votes
3answers
73 views

Command to run an application within a specific directory

I want to be able to type a line of command to do the following two commands that I know: cd ~/rpitwit_commands/ rpitwit This is because I want to automatically run it upon boot in crontab, and it ...
0
votes
1answer
529 views

How to check whether my cron job for backup using tar was succesfull [closed]

I have a cron job to tar backup websites and databases and upload the backup to a NAS. Instead of checking the tar files on the NAS. Is there any way to check if the tar backup process completed ...
2
votes
1answer
332 views

How to respawn vpnc when it stops?

As root, I've setup a crontab rule that launches vpnc everyday early in the morning (before I arrive at my workplace). But it often occurs that the vpn stopped mid day. As a result, I have to sudo ...
1
vote
0answers
626 views

wget command not working in cronjob

here is my command : wget -c -O /home/alireza/Desktop/1.mkv http://mysite.com/myfile and here is my /etc/crontab file : SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ 0 2 ...
2
votes
1answer
97 views

How to run a script as soon as the week number changes?

I would like to keep my download folder sorted. My goal is to have the files of the current week in the download folder, and the older files in a folder named after week number and year (eg 2013.09, ...
1
vote
1answer
707 views

Daily logRotate for apache at specific time

How can I execute logRotate daily at a specific time (3h30) each day? Specific details on how to do this would be appreciated. I'm on Debian.
2
votes
1answer
2k views

Crontab + Ruby on Rails: /usr/bin/env: ruby: No such file or directory

I have a ruby on rails app and I need to schedule a crontab for a rake task. */5 * * * * RAILS_ENV=production /usr/local/bin/rake -f /usr/local/www/mysite-web-production/current/Rakefile ...
2
votes
1answer
1k views

Is there a update manager whitout gnome dependencies for xfce?

I'm looking a update manager for Debian Xfce. I installed xfce on a computer which will be use by laypersons. Therefore, I want another way (graphical) to launch apt-get update && apt-get ...
2
votes
1answer
224 views

output of top gets truncated to 80 columns when run by cron

I have got the following logging script: #!/bin/bash top -b -c -n 1 >> /var/log/toplog/top.log And the following record in my crontab: */1 * * * * /home/clime/scripts/toplog.sh The ...
1
vote
3answers
41 views

How to only output commands from CRON?

INPUT: * * * * * ( /path/to/foo -x ) 3 * * * * /full/path/tothing 3 3,2,4 * * * /full/path/tothing4 3 OUTPUT: ( /path/to/foo -x ) /full/path/tothing /full/path/tothing4 3 Q: How can I truncate ...
1
vote
2answers
4k views

Globally change path for all users, even in cron

We're setting up an SGE cluster with CentOS 6. My sysadmin is installing applications that are not installed via RPM (i.e. via other means like make install) should go in a non-standard directory, in ...
7
votes
1answer
4k views

How to change cron shell (sh to bash)?

Is it possible to make commands in crontab run with bash instead of sh? I know you can pass commands to bash with -c, but that's annoying and I never use sh anyway.
3
votes
3answers
630 views

Rsync problem with cron and no problem manually

I have a backup.sh file that launch an rsync command. This rsync is to backup my dedicated server on a RaspberryPi running raspbian. (I use keychain so I don't need to type any password etc ...) The ...
2
votes
2answers
223 views

How can I manage my crontab effectively to avoid issue by multiple updates by multiple users?

I have a crontab that includes many users updating it. The problem is that because of this, it is not easy to know who did what modification of a cronjob. I was thinking to create a script to do a ...
2
votes
2answers
434 views

Why are new cronjobs ignored unless crond is restarted in SLES?

I added a new cronjob with a user (SUSE LINUX Enterprise Server 9.4): # su - XXX $ crontab -e and this is what I added: * * * * * echo `date` >> /home/XXX/a.txt but the a.txt isn't ...
0
votes
1answer
151 views

Cron Job Clean Directory

How is it possible to delete files older than 14 days in a folder using a cron job? Everything I have tried so far hasn't worked.
1
vote
3answers
639 views

cron: bash syntax not working

I am trying to add following command to crontab: I=1; for X in $(/bin/ls -r /var/tmp/*); do [ $((I++)) -le 28 ] && echo "lower" || echo "higher"; done When executed on the command line (in ...
2
votes
2answers
538 views

Logrotate doesnt start proftpd triggerd by cronjob

Im currently running of ideas. The proftpd doesn't restart, if logrotate is triggered by the cron task. Logrotate rotates all logfiles stops proftpd but does not start proftpd again. If i force the ...
2
votes
1answer
194 views

Cronjob output to log

I'm using a script for testing broadband speed and I would like to set up a cronjob for testing every n minutes and output to a file. The command to launch it from a shell console and append to ...
0
votes
2answers
3k views

What is wrong with my cron job?

I'm new to linux, and was told I could use a feature called cron job to run a python script I made execute every 10 minutes. Problem is the the python script isn't running. There doesn't seem to be a ...
2
votes
2answers
811 views

Need help with a script to test for memory usage

I'm trying to put up a temporary band-aid while I work out a solution for a app's memory leak. What I wrote was a small bash script that I put in the root on the server. This is what the script is ...
0
votes
1answer
834 views

Cron does not print to syslog

I have following crontab file - # /etc/crontab: system-wide crontab # Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and ...
0
votes
1answer
2k views

Cron job does not fire up after a timezone change

I've tried eliminating many of the common errors, 1) ensuring that the PATHs are available for cron 2) there is an endline at the end of crontab file 3) the timezone is set-up by: cd /etc cp ...
4
votes
2answers
423 views

why doesn't 0 0 * * 1 root hostname >> /tmp/hostname.txt work as a crontab?

0 0 * * 1 root hostname >> /tmp/hostname.txt The above cron entry should run midnight on monday and create a file in /tmp called hostname.txt with the output of the hostname command. But it is ...
2
votes
2answers
344 views

command not running in cron (systemctl suspend)

I have this cronjob set : * * * * * /usr/bin/systemctl suspend And it is not working. But I can run it in a shell and it works. I don't understand what could be not working. EDIT Redirecting error ...
0
votes
1answer
133 views

Why does OpenSSL automatically send me Terminal mail?

I for some reason am getting messages from OpenSSL constantly (not literally constantly, but every hour or so) sent to my Terminal mail box saying: Message 1: Subject: Cron ...
4
votes
3answers
1k views

Cron allowed special character “L” for “Last day of the month” on Debian

I'd like to know if L is one of the allowed special characters on Debian's cron implementation? I'm trying to set up a cron to run on the last day of every month. From the cron entry on wikipedia: ...
5
votes
3answers
698 views

Cron to not run on specific day but all other days

I have a cron setup to execute a bash script daily at 10pm. I have another cron setup to run monthly on the 1st of the month. Both crons launch a bash script, and the only different in the bash script ...
1
vote
1answer
111 views

Get system notification at a certain time?

Is there a way, in Linux or FreeBSD, to receive notification from system at a specified time? I'm thinking something in like of what inotify in Linux does for filesystem events. There IS a way to ...
3
votes
2answers
580 views

setting a cronjob in IST time

I am trying to set a cronjob run in a different timezone. I've googled a lot and found editing /etc/default/cron is the way to go. But this file is deprecated and I see the following message, so I ...
0
votes
0answers
30 views

Is there something as flexible as crontab for user-level autostarts? [duplicate]

I'm looking for a flexible per-user initialisation tool to kick off user daemons when the system (re-)boots. I suppose something similar to crontab would be great, which works for every user ...
1
vote
1answer
165 views

How to figure out what is performing scheduled server reboots?

I'm helping a friend with a server and it appears the server reboots every week on Sunday night. How can I figure out what is causing is the server to reboot? Aside from rebooting, the server appears ...
1
vote
2answers
561 views

Run a cron job every minute, meaning of syntax [duplicate]

I read somewhere that you can add a cron job to run every minute like this: #min hour day month weekday command */1 * * * * <your command> What does the /1 part mean? Can I ...