Cron is used to execute scheduled commands. It acts as a task scheduler on Linux and UNIX systems which will execute commands at specified times set by the user. Cron has a great deal of customization and is often used on server environments where common tasks are run on a regular basis.

learn more… | top users | synonyms (2)

3
votes
1answer
235 views

Using a cronjob to clean /tmp

Is it save to use bash script and a cronjob to remove all files in /tmp? Or should I do this differently for other reasons, maybe?
0
votes
1answer
2k views

Cannot run cron job for a php script

I want to run a php script using cron job on localhost my script is situated at - /opt/lampp/htdocs/rrugd/myscript.php now as opt is under root, i tried adding the cron job for root as well as ...
0
votes
1answer
671 views

Ubuntu VPS Automatic Backup Script

Can anyone tell me how to create a backup script for Ubuntu VPS which is used as a webserver. I also want to add it as a cron job so that it runs automatically every day midnight at ...
1
vote
2answers
2k views

Create a Screen session with a bash script using contab

I want a .jar file to run every time the server boots up (we're using a VPS), and so I've edited crontab using crontab -e and then adding @reboot bash /home/bash/startserver.sh. But I haven't even ...
0
votes
1answer
48 views

Scheduled Power On/Off of 2nd HDD

im using a ubuntu 13.10 Server. I want to switch off the 2nd HDD completely and only power it up once a week to back up the system+data from the 1st HDD. I know how to use crontab, but I dont know how ...
0
votes
1answer
45 views

Crontab wont run a script

I've set a script to run every 10 minutes using cron, but it does not run. It works when I run it manually. bin path is /usr/bin/. The script contains: #!/bin/bash scrot 'screenshot.png' -e 'mv $f ...
0
votes
2answers
132 views

Start-up / Reboot scripts for different users

I'm still trying to learn a little more about bash scripting and start-up / reboot, I have read about crontab @reboot and also just looking at other options but I just wondered if someone could maybe ...
0
votes
2answers
52 views

# in crontab used for what?

If I add up the # in front of some crontab task then it won't work and behave as comment ? right ? I want to disable some task for sometime until I like to enable. # * * * * /home/user/xx Thanks ...
1
vote
1answer
122 views

Ubuntu Server cron job doesn't work

My script that is supposed to run only when the server is on isn't working correctly when run by cron. If I run it manually, it works. backup() { if pidof java &> /dev/null; then ...
2
votes
1answer
45 views

Check when folder was last synchronized with rsync

I'm using a cron job to backup a folder to another computer. I'm not sure whether or not it succeeded and /var/log/rsync.log is only showing errors, all of which occured before the scheduled backup. ...
1
vote
2answers
234 views

screen shot from command line

I am writing a sh file to take screen short and want to schedule in crontab but when i run the .sh file it run OK no problem happens but when try to schedule it in crontab i got an error like ...
1
vote
1answer
841 views

Crontab GUI for Ubuntu 12.04

Is there any app for the Ubuntu 12.04 LTS (server, no visual interface) in order to easily manage crontab? Maybe a daemon running in background and access to it via a web browser? Using crontab -e is ...
1
vote
1answer
5k views

Crontab error “No crontab for root”

when I write crontab -e command in terminal, I get this error message: no crontab for root - using an empty one 888 I don't know what '888' is meaning? Config file of crontab /etc/crontab: # ...
0
votes
4answers
11k views

How to Setup a root cron Job Properly

I tried to setup a root cron job to run a Bash script as root, to run at minute 7,37, every hour, every day of month, every month. This script is located in /usr/bin and named tunlrupdate.sh is used ...
0
votes
0answers
286 views

Cronjob for MySQL Backup Bash Script Not Running

I am trying to backup many MySQL Databases on a daily basis into a Single ZIP. The bash script works fine by itself (ran in normal environment), but when the Cronjob takes over it does not run. Infact ...
0
votes
1answer
218 views

How to detect error in cron jobs

The reasons why a cron job may fail is really very large. Most common reasons may be, Syntax error Using executable without proper path Using a shell variable which is not defined in cron ...
1
vote
0answers
47 views

Make CronTab not asking for id_rsa keyword when running in terminal

I like to do some git pull inside a script and see see output of it. So I made up this cronjob to test: DISPLAY=:0 * * * * * mike /usr/bin/gnome-terminal -x zsh -c "/var/www/up.sh; zsh" ...
0
votes
2answers
37 views

How to put availabe disk space into filename?

I have a SFTP user only and I want it to be able to see available space. I want to make a cron that runs each 30 minutes, to delete the old file and put the new file to show free disk space. I could ...
1
vote
1answer
2k views

Running PHP Cron Job with Arguments

Im trying to run a PHP script, once a day, on ubuntu 13.10 server with php5. I have cron jobs set up, via ajenti control panel, verified with crontab -l, for this command. php /path/script.php ...
1
vote
1answer
9k views

Open firefox from bash file “Error: no display specified”

I need to open a browser and access my server with the ip address 1.2.3.4. First I ping my server and if the ping did not fail I launch the home page in a browser. For this I have written a bash file ...
0
votes
1answer
79 views

Why the cron job did not fire on ubuntu 12.04?

Here is the script sqlite_backup.sh under $HOME/: #! /bin/bash now=$(date +%d) echo "Welcome to Sqlite backup script" sqlite3 /var/www/db/nbhydb.sqlite3 << EOF .timeout 20000 .backup ...
0
votes
0answers
865 views

Java -jar runs via shellscript but not via cron

I have a shell script that I want to schedule via cron to be ran every 10 minutes. The shellscript runs a jar file. If i run the shellscript via ./sensorrreader.sh it works just fine (creates a file) ...
0
votes
0answers
25 views

Crontab is not giving me error notifications [duplicate]

I don't always have the most reliable internet and I miss the feature in Windows where you're network icon changes. So far the only thing I can find to replace this is a cron job that pings. I set up ...
1
vote
2answers
53 views

Network Information for Theft Prevention [closed]

I haven't seen much of this around, and I'm not a network expert/sysadmin, so I need some advice. I have a laptop that I'd like to "protect" against theft (this is really a game more than a real ...
1
vote
1answer
188 views

System crontab entries not being run

I am running Ubuntu 12.04 LTS Desktop. I have used the /etc/crontab to set up a couple of entries that should run at different schedules. Now, the problem is that these do not seem to be running. I ...
0
votes
0answers
63 views

Cron not running script

I have a script that works when called: /usr/local/bin/myscript #this works fine Permissions for the file are: -rwxr-xr-x 1 root root 155 Jan 27 09:34 myscript I've added a line to /etc/crontab: ...
1
vote
1answer
2k views

no crontab for [username] - using an empty one

I want to run a bash file (abc.sh) on the desktop that runs a python file on the desktop as well. How can I do that? I tried to do the following simple task just to test the crontab: (here the abc.sh ...
0
votes
2answers
3k views

How to remove or delete single cron job using linux command?

I have created cron jobs for my site which is listed below and they are working fine.I print all cron job by using this command $cronfiles=exec('crontab -l',$output); echo "<pre>"; ...
1
vote
1answer
133 views

Why do I get that error from a CRON job?

I am trying to write a cron script to check if my minecraft server is running or not and if it is down to run the start up script. Here is what I have and this is the error I get when running it ...
0
votes
0answers
132 views

@reboot crontab vs startup script

What is the difference between using @reboot cron and writing a startup script (a script in /etc/init.d) ? In which scenarios should one be chosen over another ?
0
votes
1answer
45 views

Only part of crontab working [duplicate]

i have a line in crontab: * * * * * date >> /home/pana/temperatures.txt; hddtemp /dev/sda >> /home/pana/temperatures.txt ;hddtemp /dev/sdb >> /home/pana/temperatures.txt ;sensors ...
3
votes
4answers
81 views

Is it possible to limit Software Center or apt-get install downloading to a specific time of day?

I have free bandwidth everyday from 12 am till 7 am. That means I put everything that I want to download in the software center and go to sleep. I want the download process to stop at 7 am. For that ...
0
votes
1answer
59 views

cron not outputting correctly?

Please forgive my ignorance. I have searched, but perhaps I’m not sure really what to search for in order to answer my question myself, so I’m turning to this forum for a little guidance. I’ve ...
2
votes
1answer
122 views

Where to check if a cron job was ever run?

I set a few cron jobs locally on my machine. They were supposed to run each night at 8 PM. Where can I see or check that they actually run?
0
votes
1answer
64 views

A shell file containing count but not showing when I try to run from crontab

I am new in writing shell script i write a script like this #!/bin/bash PID=$(ps -ef | grep "sh gps.sh" | grep -v grep | awk '{print $2}') if [ -z $PID ] then cd /opt/etrans/cronjobs ...
1
vote
0answers
106 views

Configuring logrotate without root access (per user log rotation)

How best can logrotate be configured, on a per-user basis, to rotate files in the home directory of the user, under control of a per-user 'crontab -e'?
0
votes
0answers
41 views

No cron job for root

I am trying to make source distribution(python package) which has setup.py file that deploys cron job using subprocess call. But Error is coming : No cronjob for Root Here is setup.py file : $ ...
0
votes
0answers
23 views

How to autorun bash script in terminal as root? [duplicate]

I'm trying to make this script to autorun at startup, it needs root priviges, but I'm trying to run it without typing in my password. I have tried to add it with crontab, but nothing seems to happen. ...
2
votes
2answers
999 views

Setting cron to run a shell script: random wallpaper from a webpage

I have written a shell script which downloads random wallpaper from a web-page and sets it as a background every 5 hours. Here is the script: #!/bin/bash countervar=1; finish=0; cd ...
1
vote
3answers
1k views

Who is sm-msp-queue and how does he/she/it flood my /var/log/syslog?

I run Linux BeagleBoard-xM 3.12.5-armv7-x10 #1 SMP Fri Dec 13 03:06:20 UTC 2013 armv7l armv7l armv7l GNU/Linux and my /var/log/syslog gets flooded by messages like Jan 11 10:21:09 BeagleBoard-xM ...
0
votes
0answers
340 views

crontab doesnt upload file via ftp script

I Write script that make a zip file with /var/www Directory And mysqldump db And upload it via ftp And change mode to executable file And put It in cron tab but file doesn't upload !!! #!/bin/bash ...
0
votes
1answer
402 views

How can I get mysqldump to use the credentials from mysql_config_editor in a crontab-executed script?

I am setting up a daily backup of a MySQL 5.6.14 database using mysqldump on an Ubuntu 12.04 Precise server. I created the credentials file in the root home directory (.mylogin.cnf) according to the ...
0
votes
1answer
59 views

Crontab script entry not working

beginner here. I have a script called updateTf2.sh It's contents #!/bin/bash /etc/init.d/srcds stop ./steamcmd/sh +login anonymous +force_install_dir ./tf2 +app_update 232250 +quit ...
0
votes
3answers
163 views

Can't get crontab to repeat command every five minutes

I'm trying to make crontab run a sh script every 5 minutes. This is my root (sudo crontab -e) crontab setup: */5 * * * * /etc/test.sh and this is the script: #!/bin/bash echo "time:$(date)" ...
0
votes
1answer
165 views

Running Key Remap Script at Startup

I'm trying to re-map my left Alt key to the Alt Gr and Alt Gr to Left Alt. So far I've been able to do it in terminal, but it never runs it on start up. I've read multiple AskUbuntu questions, but ...
0
votes
0answers
236 views

cron job exetue, but receive error + 500 internal server error

I created a cron job on my apache server's cPanel, every 5 minute push the script, with this command: lynx -source http://mydomain.com/...c_html/xxxx.php and that script does not execute.. i receive ...
0
votes
0answers
59 views

Logrotate throws a SQUID4 error

I am using squid3, on my Ubuntu 12.10 server, for some months now. I never had problems like that until 4 days ago. Since then I get this mail every day: >Topic: Cron: test -x /usr/sbin/anacron || ...
0
votes
1answer
95 views

crontab entry to reboot than email

I got my weekly crontab reboot entry to work using /sbin/shutdown -r but now I want it to email me when the reboot happens. Ideally I would like the email to happen after it rebooted so I know the ...
0
votes
0answers
60 views

Folder Action for Ubuntu [duplicate]

I have a question concerning Ubuntu folder action , I need a script to notify me when a file is add to a folder or the folder changes , is there any possibility for that. I found some articles ...
0
votes
1answer
54 views

Cron Script Length

I have a backup script, a script that cyncs file with other files on my computer, and a script that uploads files to my website with ncftp. I used cron to load .sh files, and my shorter scripts work, ...