Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Bash Scripting

Just keep in mind, whether it successfully works or not, it's going to print the success message. It has no kind of error control (which for your implementation is probably fine, this is changing file permissions, not rocket science, lol)

If you do decide to run it as a cron, you should probably use absolute paths instead of relative (including the commands), since I've had a number of scripts run fine when executed by a user, but break when trying it as a cron job. Adding the ab paths fixed it. Also, I agree with the sentiment that a cron job ever couple minutes for something like this probably isn't a great idea.
chmod 775 /$FOLDER/*
means that just the permissions on files and directories inside $FOLDER get changed. Thus $FOLDER/file but not $FOLDER/folder/file ...

@OP
your script looks fine. There are probably better ways to do this but it will work adding it to cron.
/path/to/script

Yes,
is allowed thus it being run all the time.

Cron explanation if you don't know how.

# * command to execute
# ┬ ┬ ┬ ┬ ┬
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ └───── day of week (0 - 7) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0)
# │ │ │ └────────── month (1 - 12)
# │ │ └─────────────── day of month (1 - 31)
# │ └──────────────────── hour (0 - 23)
# └───────────────────────── min (0 - 59)
(Mar 27, 2014 10:52 AM)Trip2nite Wrote:  My mistake, forgot the option.

He would need to put -R behind chmod.

so the command would look like this:
Code
chmod -R /$folder

-R =

The -R flag was there aldready 🤫


Possibly Related Threads...
Thread / Author Replies Views Last Post
by kingpzzoJan 9, 2016 04:28 PM 0 111 Jan 9, 2016 04:28 PM
Last Post: kingpzzo
by cewaApr 27, 2015 11:33 AM 9 199 Apr 27, 2015 11:33 AM
Last Post: cewa
by Blackhat.rlshDec 5, 2012 04:32 PM 2 111 Dec 5, 2012 04:32 PM
Last Post: Blackhat.rlsh