Posts Tagged ‘fstemp’

.fstemp files on OS X

April 15th, 2010

.fstemp files are the temporary files that Mac OS X creates when synchronising files.  They are predominantly used for Home Syncing by network clients and syncing with Apples iDisk product.  Normally once a the task / process has finished the .fstemp files will be removed, however if errors occur or the process is interrupted the .fstemp files will be left.

These temporary files can get very large, and often end up consuming large amounts of disk space.  – Yet as they are not visible from the finder it’s not immediately apparent where the space has gone.  Removing the .fstemp files is often a good place to start regaining that invisible, and illusive, missing disk space!

.fstemp files can be seen by running the ls –la command from the terminal (shell).  As the filename starts with a ‘.’ it is a hidden file. To see how many you have lurking on your mac run the following command in a shell.   On busy servers this can be huge number:

find . -name ‘.fstemp’ | wc -l

The easiest way to remove them all is to run this command in a shell.  Run it as root if needs be:

find . -name ‘.fstemp’ | xargs rm -fr

 

How can I stop .fstemp files from getting left?

One of the best ways is to stop background syncing by network clients.  By syncing only at time of log out or log in you’re ensuring all applications are closed and nothing will be preventing copying.

I’ve also found that they seem most common when syncing the larger files.  Not syncing the users iPhoto library’s or iMovie projects helped on my system.

If you do want to keep using background sync, not synchronizing the users library often helps although this will loose the backup of any preferences they have saved.

 

Can I just delete all .fstemp files?

I’ve never had any problems from doing this.  Best to do it when the servers quiet if possible.  On troublesome servers I sometimes add it into the cron for the early hours of the morning.

 

How can I delete all .fstemp files easily?

Removing .fstemp files on OS X can be done by run the following command from a shell (terminal).  It will tell you how many there are and then delete them all:

find . -name ‘.fstemp’ | wc -l && find . -name ‘.fstemp’ | xargs rm -fr