[PLUG] What are .lock files

chris (fool) mccraw gently at gmail.com
Fri Apr 25 15:56:36 UTC 2008


On 4/24/08, John Jason Jordan <johnxj at comcast.net> wrote:
> Every time I try to do a backup it stops when it hits a .lock file.
>  This kills dead the idea of unattended backups. Using locate I find a
>  dozen of them on my hard disk.
>
>  It takes only 15 minutes to complete a backup of ~/, but it's annoying
>  to come back to the computer only to discover that the backup stopped
>  halfway through when it hit a .lock file.

while file locking under unix is a hairy story
(http://en.wikipedia.org/wiki/File_locking#File_locking_in_UNIX),
backing up locks needs not be.  in fact, backing up a lock file really
shouldn't even hang--i'd be interested to see (the relevant portion
of) an strace of the backup process.  running as root should get every
file, regardless of type, if you use the right options (backing up
device files can be tricky if you're not careful.../dev/sda is a
really big file if you try to read its contents, and won't fit onto
/dev/sda1 without some compression =))

all that aside, if you (or your backup program) is using something like tar,

   tar --exclude=.lock

will dodge the problem.  if not using tar, generating a filelist and
then putting the files into the backup should somewhere, somewhen,
give you an opportunity to:

   grep -v /.lock$

luck++;



More information about the PLUG mailing list