+ Reply to Thread
Results 1 to 1 of 1

Thread: Cron Job: Deleting Files & Folders

  1. #1
    NiceCarpet's Avatar
    NiceCarpet is offline x10Hosting Member NiceCarpet is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    9

    Cron Job: Deleting Files & Folders

    Hello : )

    I currently have symlink anti-leech script running and need a cron command or php script to be ran by a cron job to remove files/folders in this dir: "/home/webacc/public_html/files/*" apart from index.php and .htaccess

    I have been trying a few commands I have found on Google but nothing to aid me yet >< eather they choke on system() commands or just don't work with out any error.

    So could someone please assist me in the code needed that will run on these servers correctly (I have PHP Intermediate version if thats any help).

    Thank You very much : D
    Edit:
    For anyone else that is having this problem here is what I ended up doing:

    I put a .htaccess that contaned:

    Code:
    IndexIgnore *
    DirectoryIndex ../index.php
    So since my cron job uses this command set "rm -rf /home/MYUSERNAME/public_html/files/*"
    with the time setting of:

    Code:
    */5 * * * *
    (Every 5 minutes)

    It would remove both files and folders but not .htaccess (since rm doesn't deal with anything that has a dot in front of it)
    Last edited by NiceCarpet; 11-15-2007 at 07:51 PM. Reason: Automerged Doublepost

+ Reply to Thread

Similar Threads

  1. Windows Sortcuts
    By Blazer9131 in forum Computers & Technology
    Replies: 3
    Last Post: 11-29-2007, 04:07 PM
  2. Viewing files in folders
    By jackaroo in forum Free Hosting
    Replies: 2
    Last Post: 10-14-2005, 12:31 PM
  3. deleting files your ftp client wont delete
    By komodolinux in forum Free Hosting
    Replies: 3
    Last Post: 10-07-2005, 08:02 PM
  4. Replies: 0
    Last Post: 09-21-2005, 09:25 AM
  5. uploading folders not files
    By cheese1421 in forum Free Hosting
    Replies: 5
    Last Post: 09-05-2005, 03:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers