Archive for the 'Linux' Category

Shell script to get the oldest file

Friday, February 16th, 2007

Hopefully someone else might find this bit of code handy too. I used it in a shell script to get the oldest numbered file in a series of files (eg the oldest file from a set of file_1.gif, file_2.gif, file_3.gif, file_4.gif etc)

ls /mnt/nfs/data/file_*.gif –sort=time | tail -1 | cut -d _ -f 2 | cut -d . -f 1

Big Brother permissions

Saturday, September 23rd, 2006

I have been installing multiple instances of Big Brother on Centos 3.5 at one of my current job sites. After everything has been downloaded, installed, patched, updated, dependencies resolved and many coffees later I hit the url and get this error:
“You don’t have permission to access /bb on this server”

A problem I have had each time, and I keep forgetting which directory permissions are causing the problem.

The solution is to make sure the big brother root directory has execute and read access for the webserver. So if you installed at /home/bb/bb1.9e-btf, you need to change the permissions for the /home/bb directory.

chmod u+xr /home/bb