Archive for the ‘UNIX’ Category
Aug
19
Need to sync some files? Locally or remotely? How about re-thinking an old friend, rsync?
You may be like I was, and have discounted rsync for a long time due to the security risk imposed by running the “r” daemon on your servers. Guess what? You can not only use rsync to sync up local directories on the same server (this can be real handy for backups), but you can also sync from one server to another via SSH rather than the rsync daemon. This would be much like scp, only you can sync whole directory trees.
So. Let’s say you want to sync two local directories, how would you do that? Well, if we are syncing /export/datadir to /export/backupdir it would look something like this:
rsync -aruv /export/datadir/ /export/backupdir/
It’s just that easy. Now, those command line switches, what do they do? Check it out:
a = archive
r = recursive
u = skip files that are newer on the receiving end
v = verbose, tell me what's going on
There is another one that is good when syncing between two separate servers, and that is the “z” switch. This tells rsync to use compression during the file transfer thus saving bandwidth. Let’s see what the above would look like from one server to another, as if you are running the command from the server you are syncing to:
rsync -aruvhz --progress server1:/export/datadir/ /export/backupdir/
There are a couple other options there, did you notice? I have added the “h” which tells rsync to output information in human readable format (GB, MB, K, etc), and the –progress which tells rsync to report exactly that, the progress of each transfer. You can use these with local transfers too, mix and match as you see fit.
Aug
7
This is just a quick tip for anyone that uses VNC, expecially on Linux. This works in TightVNC and maybe others too, it might be a VNC standard. When using the VNC viewer or client on Windows, you can right click on the title bar of the window to get some extra options, like sending Ctrl-Alt-Del to the host to log into a Windows box. When using this on Linux, right clicking on the title bar had no effect. Uh oh, how was I going to login to my Windows box? Well, I found that F8 will bring up the menu and allow you to do various things, including sending keystrokes to the host you are connected to. So, there you have it. When in doubt, try F8 when using the VNC viewer.
Jul
26
OK, I admit that headline is a bit misleading, but it’s also true. I spend time regularly working in an environment that is all Solaris UNIX running on SPARC chips, therefore we use SPARC based Sun Blade workstations exclusively. This means that the platform we use to manage and develop on is the same as the platform we manage, which is a good thing when you are dealing with hundreds of mission critical servers.
I was speaking to one of my Sun contacts, enquiring about some workstations when I was informed that Sun has now dropped all Sun Blade workstations based on the SPARC chip. You will only be able to buy workstations with Intel or AMD (x86) processors.
What!? I personally think that’s stupid, and it puts me in a bind. Before you flame, I know why they did it. The SPARC workstations are expensive and I am sure they don’t sell very many so they decided it was more economical to stop making them altogether. And yes, I know I can run Solaris x86, but why would I want to introduce a whole new architecture just for managing my existing systems?
Either way you slice this, I think it is a sign of the times. Quality and performance will give way to cheap. I read articles on the Web about how solaris is slow and the SPARC chip “sucks” because it “only” goes up to 1.5GHz or so when Intel goes over 3Ghz. That just makes me smile because it just shows how little people know about how things work.
When you get right down to it, I guess it all comes down to money.
Jan
25
For anyone who found the Solarum Solaris reference handy, and would like a portable copy, I split it into columns and PDF’d it so it would make an easy download. Check it out in the downloads section.
Dec
12
Sun Microsystems is a great company anyway, they make outstanding hardware and deliver a rock solid operating system. Add to that all of the stuff they open source to the public and it just gets better. Now they have announced that their latest chip, the T2 or Niagra 2 has also been open sourced. This means that anyone can get the code, plans, schematics, etc. and make their own … for free. Think about that for a second. Let’s say you are a device maker, some mobile gadget, and you need a CPU to work with. Would you rather use something like the T2, which is unmatched in capabilities for free? Or pay a few million for an Itanium chip? Yeah, me too. I’ll take the Sun chip and run before they change their mind. They have opened other chips too, like the T1, and software like Java and Solaris. Good stuff as far as I am concerned.
Read more …
Oct
21
Ok, here is a quick tip that has come in handy quite a few times in my days writing shell scripts, for example in bash. Let’s say, for whatever reason, you need to chop off the end of a string (like a variable). Chopping the beginning is easy, just use the cut command, but in order to chop the end you have to know how long the string is so you can tell it where to start. In this example, we are going to us the wc command to figure out how long the string is, and then subtract 1 to cut the last character. You can subtract however many you want depending on how many characters you want to cut. Check it out … Read the rest of this entry »