command on linux

Posted on 2006-05-24
Last Modified: 2012-08-14
How can i run this command  every 2 hour

chmod 777 -R /var/www/html
Question by:teera
    LVL 95

    Assisted Solution

    by:Lee W, MVP
    Add it to your crontab file.
    LVL 14

    Assisted Solution


    Hmm... why do you need to run this every 2 hour?

    If you are running Mandriva and have the permission guarded by the system, whereby any changes will be reverted automatically, check your msec setting (man msec for more detail).


    Author Comment

    be cause in the mornig i will change to mode 777 at  that time i take the cable out I afraid I do  not change permission back be fore I connect cable
    LVL 48

    Expert Comment

    Why are you changing permissions to 777?  That's a huge security hole!
    LVL 38

    Assisted Solution

    Login as root or the owner of /var/www/html, then run
    crontab -e

    and type

    * 0,2,4,6,8,10,12,14,16,18,20,22 * * *  chmod 777 -R /var/www/html >/dev/null 2>&1

    then save it.
    LVL 3

    Accepted Solution

    * */2 * * *  chmod 777 -R /var/www/html

    This will also run every two hours and is far easier to type ;)

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now