Hi Now i running my cron in putty, I have created the cron using crontab command and i list using crontab -l but still my cron not running it does not update the value in database.
Related
How can I delete or clear all the cron job that I made previously and just run new cron job that I assigned? I'm using crontab -r but it just clear in the crontab display, but it still runs that cron job and the previous cron job that I have already deleted by using that code.
After I clear cron job using crontab -r, I run crontab -l and it shows this output.
No crontab for trygcp
Use this command,
crontab -e
to access crontab, in there you can deleted specific line or job you created.
About the output you are getting, that only means there is no crontab created under the username trygcp
What you can do is this:
crontab -u [username] -e
Where:
-u define user
-e edit user's crontab
This command will create a crontab under your username, but remember you must have root privilege for you to do this.
I have a script abc.sh which runs a command to generate a csv file and send an email. This script runs fine when I manually execute it.
I have added the following entry to my crontab using crontab -e command:
00 18 * * * /home/abc.sh
However, this cron job does not execute at all.
I checked
service crond status
and the CRON service is running.
Am I missing some permissions?
I need a shell script that would run two .sh files which are in the directory: /opt/tomcat-latest/bin
#!/bin/sh
cd /opt/tomcat-latest/bin
./shutdown.sh
./startup.sh
Would this code achieve my goal? If so how do I make it on a cron job that runs every 2 hours? I have a Linux Centos VPS and DirectAdmin admin panel.
I think the easiest solution would be to run directly the commands with its full path from cron, instead of using a sh script.
Something like this in the crontab would work :
* */2 * * * /opt/tomcat-latest/bin/shutdown.sh && /opt/tomcat-latest/bin/startup.sh
That would run every 2 hours
you can edit crontab with crontab -e and check the crontab syntax here : https://fr.wikipedia.org/wiki/Crontab
I've always used cpanel to set up con jobs but I don't have cpanel now.
So I added a PHP file in the cron.hourly but I want to be sure it will run.
There must be some way to do this. Like a command that lists all the cron jobs that exist?
I am on Debian 7 64 bit.
If you use crontab -e the crontab job will be syntax-checked
If you are just editing /etc/crontab or /etc/cron.*/* there is no automatic checking
nothing will check the code of your job will actually run successfully.
To list all cron jobs for a user:
crontab -u <user> -l
To list all cron jobs for root:
crontab -l
I'm trying to run a command by cron in Raspbian.
If I run ./sec_cam.sh, than my script runs, If I try to run it via crontab every 5 min, than nothing happens.
crontab -e shows me the followings:
*/5 * * * * ./sec_cam.sh
Did I configure the crontab wrong?
Thx in advance
scripts started from a cronjob are not setup with your usual environment, especially not with your current working directory (referenced by the . in ./sec_cam.sh). so to make this work you should specify a full path name like /home/user/sec_cam.sh