linux script help

There are 4 replies in this Thread which was already clicked 892 times. The last Post () by delboy13.

  • Yes that command will do the trick, you might want to run some if statements too to check if the file/folder exists and if true then delete it.


    rm -rf "/absolute/path/to/folder"

    • Official Post

    I have not tested this but will try to help.


    Create a file named remove.sh and paste the line below inside it.

    Bash
    #!/bin/sh
    rm -rf /path/to/foldername


    FTP this file to /var/script and give attributes 644.


    Now setup a cron, Start the crontab editor from a terminal window with this command.


    Code
    crontab -e


    Add the line below to the config.


    Code
    */10 * * * * /var/script/remove.sh


    This should remove the folder in question every 10 minutes.


    Let us know if it works.

    • Official Post


    Make the file executable ( attributes 755 ) and it should be fine.

  • thanks Underworld & master G. will try tomorrow don't need this really as a cron as it will be an uninstall file on image. just playing about with an image at the moment. don't know nothing about coding but tying what i can. even edited a skin to how i wanted it took about a day but got there.

Chat about everything else!

A friendly forum for off-topic discussions, random questions, and community bonding. Your space for conversations outside our main categories. Discuss hobbies, news, games, or anything else with the wider community.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!