Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User smile's Avatar
    Join Date
    Oct 2004
    Posts
    70

    Default removing files thru cron

    Hi,

    My potential client asked if he could remove the files on his shared hosting account using the following cron

    1 * * * * rm /home/hosting/public_html/dailylog/*

    Can rm command work on shared hosting account ?

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Well, you could, but one has to ask why - surely fixing whatever application is generating the files would be best.

    Either way, you should really use the -f qualifier on the command:

    1 * * * * rm -f /home/hosting/public_html/dailylog/*

    Are you aware that that will run rm 1 minute past each hour?
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Registered User smile's Avatar
    Join Date
    Oct 2004
    Posts
    70

    Default

    Hi Chirpy,

    Thanks a ton !!

    Client just asked and I was not sure of this...may be I'll ask him to modify the interval to execute the job

Similar Threads & Tags
Similar threads

  1. removing many files at once
    By innsites in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-12-2009, 08:47 AM
  2. Removing left over files from upgrade
    By shadowhaxor in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-26-2007, 10:27 AM
  3. Removing multiple files
    By shamrocks in forum Data Protection
    Replies: 9
    Last Post: 05-20-2007, 11:36 AM
  4. Removing Files
    By ukhost in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-20-2002, 11:16 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube