Monthly Archives: July 2007

Ubuntu Desktop: How to Find Your Application Files that Store Your Personal Preferences

Today I was trying to find the location of my chat logs for gaim in Ubuntu and noticed that none of my logs were being found through the File Search program (‘Places’ -> ‘Search for Files’). After digging through a few Google queries, I ran into a blurb about hidden folders prefixed with a period.  It turns out all personal preferences user specific files for your applications are stored in directories with this notation ‘/home/user_name/.program_name’. So all my personal files and settings related to gaim would be stored in ‘/home/alex/.gaim’.

The File Search program ignores hidden files by default. In order to search hidden files, click on the ‘Available Options’ drop down list and select ‘Show hidden and backup files’ and press the ‘Add’ button. This should include all hidden files in your search.

To see a list of the hidden directories in your home folder, open the shell and type the following:

ls -a

By default, your command prompt should open in your home folder. So you shouldn’t need to navigate to ‘/home/user_name/’.

Mirroring an FTP site in Ubuntu Server

The other day I was tasked with mirroring a FTP site, about 5+ gigs of files, on our local server. Mirroring directories is a fairly common task when administering servers, however, the main differences when tasked with this job are the protocols available, whether the job is bi-directional or one way, and the how fast the mirroring needs to occur.

Lucky for me, this job did not demand instantaneous sync and the job was only one way – meaning changes from a server were reflected only from one server. The biggest problem was this job was limited to using only the FTP protocol for mirroring the site. This immediately removed rsync, a popular server/client for syncing directories remotely, as an option. After a quick search through the Ubuntu forums, I stumbled upon a post that detailed several programs on mirroring an FTP site using FTP protocol only. I chose a program called ‘ftpmirror’.

Ftpmirror is a program that lets a user define ‘packages’, which are configuration details for mirroring an FTP site, and scheduling these ‘packages’ to be run daily, monthly, or weekly. To install this program, I typed

sudo apt-get install ftpmirror

If you’re using Ubuntu Server, the configuration files should reside in the ‘/etc/ftpmirror/’ directory. Upon browsing through the directory, you will find a file called ‘ftpmirror.cf-sample’. This file contains a few example ‘packages’ that can be used as a template. The user puts any active ‘packages’ in the ‘ftpmirror.cf’ file. My ‘ftpmirror.cf’ file looks like this:

package = alexkuo_media
ftp-server = master.alexkuo.info
ftp-user = mirror
ftp-pass = password
remote-directory = /media/pics/
local-directory = /home/deploy/media/pics

This package uses the directory ‘/media/pics/’ as the root directory on the ftp server ‘master.alexkuo.info’ and uses the login/password, mirror/password, to login into the remote server. All files, directories, and subdirectories found in the ‘/media/pics’ directory are then downloaded into the ‘/home/deploy/media/pics’ directory on the local machine once the package is activated.

I decided to run this job once a week, so I added the package to the ‘/etc/ftpmirror/list.weekly’ file. To do this, open the ‘list.weekly’ file with a text editor. Mine looks like this:

alexkuo_media

Pretty plain huh? I removed the comments that originally came with the file, so it looks pretty bare. Adding another package involves defining another package in the ftpmirror.cf file and appending the package name on a new line in one of the *.list files.