Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Jun 2004
    Posts
    49

    Default cron job help

    Hello, how can i create a cron job that runs every five minutes and does this:
    cd /tmp; rm -rf p*.*;

  2. #2
    Member
    Join Date
    Jan 2005
    Location
    Earth
    Posts
    1,050

    Default

    Create a file say, 'deltempfiles' under any directory and insert the following lines :-

    #!/bin/bash

    cd /tmp;
    rm -f p*.*;

    Save the file and chmod it to 755.

    Edit the cron file for root at /var/spool/cron/root or just do crontab -e

    and set the cron as :-

    5 * * * * /Path/to/deltempfiles

    Save the file and restart cron service :- service crond restart

Similar Threads & Tags
Similar threads

  1. Cron Job Help Please...
    By mikka12 in forum New User Questions
    Replies: 5
    Last Post: 07-12-2010, 08:49 PM
  2. How to cron job?
    By dachooch in forum New User Questions
    Replies: 4
    Last Post: 05-03-2010, 08:15 AM
  3. about cron job
    By persianwhois in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-14-2007, 08:28 AM
  4. cron job
    By albertldee in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-11-2003, 12:08 AM
  5. Cron Job
    By Dawson in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-13-2001, 07:06 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube