Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Cron jobs

  1. #1
    New Coder
    Join Date
    Nov 2007
    Posts
    41
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Cron jobs

    Hello,

    I have never used cron jobs before but really need to set one up that deletes files in a certain folder every Friday.

    I know how to set one up to run every Friday, but I'm just not sure what the command would be to do this.

    Thanks!

  • #2
    Senior Coder o0O0o.o0O0o's Avatar
    Join Date
    Jan 2008
    Location
    C:\Windows\System32
    Posts
    1,018
    Thanks
    19
    Thanked 9 Times in 9 Posts
    Do you have shell access. or you want to delete files through php script by cpanel
    Please de-reputate me
    © 0o0o0o0

    Its better to rule in Hell then to serve in Heaven

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Or there might be an interface in the CP to set cron jobs.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #4
    New Coder
    Join Date
    Nov 2007
    Posts
    41
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Yep abduraooft, that's exactly what I'm using... but I just don't know what command to use. Unfortunately, I can't just type "Delete files in tmp folder" and set it for every Friday. I don't know what fancy linux code to use

  • #5
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Make sure you back up before you do this...

    Command you would probably want is something like this...

    Code:
    /bin/rm -f /path/to/directory/with/files/
    if you need to delete the files + sub dirs...

    Code:
    /bin/rm -rf /path/to/directory/with/files/*
    If you only want to delete html files

    Code:
    /bin/rm -f /path/to/directory/with/files/*.html
    etc

    Note /bin/rm is the path on my system. It may be different on yours.

  • Users who have thanked bcarl314 for this post:

    sakka (10-14-2008)

  • #6
    New Coder
    Join Date
    Nov 2007
    Posts
    41
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thanks! I'll give it a shot! Take care.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •