Answers
Got a burning question about open source or the kernel? Whatever your level, email it to lxf.answers@futurenet.com
Neil Bothwick fixes nonfunctional FOSS – fast!
Q Unlocking Thunderbird
My computer is running Ubuntu 20.04.03, and
Thunderbird
is the latest from Ubuntu’s repositories. When I copy my home folder to an external drive I get this error message:
This is the relevant part of my backup script.
The lock file referred to is generated whenever
Thunderbird
runs, so deleting the lock file doesn’t solve the problem.
Bryan Mitchell
A
Lock files are used by software to indicate that they’re already using a directory. In the case of this file, it tells Thunderbird that an instance is already running, so if you try to run Thunderbird again, it opens the existing instance instead. Lock files tend to be read-only, so copying one with permissions intact won’t work. In this case, Thunderbird creates a symbolic link to a non-existent file, hence the inability to copy it.
You’re not using the best tool for this job in cp. You don’t want to copy, or try to copy, everything. Even with -u it’s far from ideal. A better tool is rsync, which synchronises two directories, copying just what’s needed. It’s also able to copy only the parts of files that have changed, so a small change to a large file doesn’t need a wholesale copy. To back up your entire home directory, you only need:
Note that the trailing slashes on the directory names are important. This will still try to copy your lock file, but rsync has an option to exclude files:
This will skip all lock files. Unlike your cp command, rsync will try to sync everything, including files and directories starting with a dot, which is why you no longer need a separate line for .thunderbird, but you may wish to add extra --exclude items to omit some of these.
Using rsync like this continues with another possible disadvantage of your current script: files that were deleted from home will stay in the backup directory. If you don’t want this, add the --delete option to your rsync call. Alternatively, you may prefer to use a backup program to handle all the details for you. Something like rsnapshot (www.rsnapshot.org) or Borg (https://borgbackup.readthedocs.io) may be a good place to start.
Thunderbird, like many other programs, uses lock files. These are files your backup software should avoid copying.
Q Edgy hardware