0

Is there procedure or tool that can be used to find the directory in which an application stores its temporary files?

My cloud backup service reports how many files remain to be backed up. This number increases by an order of magnitude whenever I open a particular application, and decreases when I close the application. Methinks these are temp files. To prevent my backup from wasting its time indexing and uploading them, I want to exclude that application's temporary file directory. I just need to figure out where it is. Rather than rooting around in the file system like an animal, I'd prefer to use a thoughtful tool or procedure to watch where the system (or the application) is putting these temp files.

  • I have to ask...why are you doing a continual cloud backup of your entire systems. Documents and data should be daily and sent to the cloud. Your system should be done about once per week and to a local drive. If you were going to recover it would take forever to download and re-image from a cloud based backup. – Allan Jul 8 '15 at 15:32
  • Good question, @Allan. I'm doing a continuous cloud backup because I'm backing up 3 TB of video content (I'm a filmmaker) and trying desperately to back up old files. I'm making progress, thanks to Backblaze's recent performance improvements. – Crowder Jul 8 '15 at 15:43
  • I also back up to a local drive which is in an off-site rotation. – Crowder Jul 8 '15 at 15:45
  • I have a better understanding of what you are doing. My suggestion is to tweak your backup settings so you don't do the full system, just your data directories. Backing up the program files continually only takes up time and space. Excluding your temp files is just part of the equation, you are still backing up the application files. – Allan Jul 8 '15 at 16:01
  • Thanks, Allan. Backblaze automatically excludes application directories among other non-data directories. – Crowder Jul 8 '15 at 21:35
1

There are a few tools you can use to monitor file accesses but the two I'd recommend are (with their manual page descriptions):

  1. opensnoop - snoop file opens as they occur. Uses DTrace.
  2. lsof - list open files

Both are shipped with Mac OS and should do what you need. You'll need to run opensnoop in a terminal session before you start your cloud backup (it only displays changes after it's started) but lsof can display detail about all currently open files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .