Ever attempt to delete the Trash on OSX and run into an error that says you can’t complete the operation because you don’t have permissions to access some of the items? I am not sure how often this will happen to the average user that wouldn’t already know how to resolve the problem since the chances are high that the file or files created with different permissions required you to change to the root user in the first place. Anyhow below is a better description of the issue along with a screenshot followed by how to resolve the problem emptying your Trash on your Mac.
Earlier tonight I created a little script that will run in cron on a Linux server. The script counts the number of directories and files in a specific directory and if the count is above Y then it deletes directories and files older than X number of days. In the example script below the number of items (directories and files) that have to be located in the directory before the script to delete files older than a specific date is 10. If there are ten items then the script will delete items older than 90 days. Below the script is the entry made in a specific users cron on the Linux server.
Earlier a client with a fairly complex network setup had a power outage in one of their data centers in Dallas, TX. The power outage caused three servers and a firewall to lose power causing all sorts of other issues on the servers themselves. One of the primary issues was getting the PostgreSQL cluster back in 100% operational.
Alex and I got some new laptops the other day. I have been a Linux user primarily for many years but the laptop came with Windows 7 so I decided to give it a spin. I must say on the whole I have to say it is a very fast and usable operating system. There is just one thing I was missing and that was Linux shell commands in the terminal. Nothing fancy but I am so used to using ls,rm and grep that I almost went back to Linux. But then Alex mentioned something about adding Cygwin to his laptop which I am of course familiar with but he also mumbled about adding it to the path. I had never even considered this, so I did it and wow is it cool. All the commands I love are in my terminal now. Plus if you use console.exe you can have tabs and every thing.
I needed to clean up a directory on a server that included numerous directories each with numerous files inside each directory. I decided to write a quick shell script that would archive with tar and then compress with bzip2. The shell script requires you pass in a variable which could technically just be “*” to include all directories in the directory you are running the script from. Below is the content of the script followed by an explanation of each line of the script that will archive and compress numerous directories by looping through each directory to create a .tar.bzip2 file.