Category ‘Linux’
Backup a Linux server to a Windows PC while preserving user, group and permissions
I moved my sites to a new virtual server at Carrot Server. Their offer is (imho) better than the one over at HostEurope, however there are some downsides: they don't have a rescue system yet (you better watch your step!) and there's no backup included.
I can live without the rescue system, but no backup? No way.
Since I don't have a dedicated Linux box around at home, I needed to store the backup on my Windows PC. There's a problem with storing files from a Unix system on Windows though: You'll lose the owner, group and permission data for the files, since the file systems supported by Windows can't store this information. A backup without this metadata is useless, though.
Finding a solution
Some kind of container solution was needed. Tar archives support Unix permissions, however packing all files into a huge tar file would require transferring all data on every backup run. My internet connection at home is not T1, so transferring all data every time I do a backup is probably not a good idea (and it's perfectly useless, too).
There's rsync — the state-of-the-art tool to transfer only the changes (yes, changes, not only changed files; very useful if you have some multiple GB files around). So combining rsync and tar seems the way to go.
I could have packed all files into a huge tarball and rsynced it to my PC (effectively only tranferring the changes), but that would mean the tarball would need to be stored at the server (at least temporarily). Now imagine the disk is 95% full and you're trying to pack the whole filesystem — we have a problem here.
Fortunately I'm not the first one facing this problem: Thanassis Tsiodras outlines a way to backup your Linux server preserving permissions to a Windows PC using a loop-mounted file system on a Samba share.
This technique would require a Linux box, though. Bummer! (If I had a Linux box around, I'd backup to it directly).
Updating my Ubuntu Backup OS
The guys over at Ubuntu released their new Version 7.10 (Ubuntu versions are named year.month) today. So I thought I’d upgrade my backup installation.
I always keep a Linux system on a separate hard disk. This is quite important for me, as it’s my only sheet anchor when I mess up my Windows installation or my hard disk crashes. This Linux system is a clean Ubuntu 7.04 Feisty Fawn with some Compiz desktop effects from a 3rd-party-repository - no need for special software here, as I hardly use the system at all and Ubuntu comes with almost everything you usually need.
So Ubuntu 7.10, codename “Gutsy Gibbon” was released today, and as I always like to live at the edge, I thought I’d upgrade - well, at least I tried. The update manager stopped responding multiple times when trying to download the updater script. A quick Google search, let’s see how the servers do this… there’s a command-line tool called do-release-upgrade, maybe this one is more stable?
First it seemed it was not, since it took about 5 minutes just to find that there’s an upgrade, but it did the job or at least does it until now, and I’m already at downloading packages. At the moment of writing, I’m downloading libcroco3 (whatever this is - funny name, though).
New post will follow once the system is running Gutsy Gibbon.
Experiences with ClipShare Pro 2.0
There’s quite a market for YouTube clones, it seems. I’ve been recently working with three of these scripts, namely the commercial ClipShare Pro 2.0, the free PHPmotion and the Real Estate Video Upload Software I wrote a while ago. My experiences with these scripts are quite mixed, though.
Requirements
All of the scripts are based on PHP and MySQL - there might be other solutions out there, but since my clients all had the traditional LAMP setup I didn’t bother searching for alternatives.
For encoding, all of the scripts named use the same combination of MEncoder, ffmpeg to support the Flash video format, the ffmpeg PHP extension and FLVTool2.
Installing these software packages isn’t that hard unless you’re on something different than a .deb-based Linux system: The Debian multimedia repository provided me with the MEncoder and FFmpeg packages, I installed Ruby to run FLVTool2 (which is a Ruby script) and installed ffmpeg-php from Atomo64’s Debian Repository (thanks to Raphaël for this one).
If you’re on another system, you might end up with a lot of compiling, though.
Once you got all these things in place and made sure your php.ini settings allow the exec(), shell_exec() and system() functions you can start doing the real installataion.