Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instead of caveat, refer to flock(1) #4

Closed
hoxu opened this issue Dec 3, 2014 · 4 comments
Closed

Instead of caveat, refer to flock(1) #4

hoxu opened this issue Dec 3, 2014 · 4 comments

Comments

@hoxu
Copy link

hoxu commented Dec 3, 2014

Instead of contemplating reimplementing locking in btrfs-backup, you could just tell people to use flock(1) utility for locking. flock -n is perfect for this usecase :)

@hale
Copy link

hale commented Jan 9, 2015

Like this?

#!/bin/sh
flock -n /tmp/btrfs-backup.lockfile -c ionice -c 3 /location/of/btrfs-backup.py /source /destination

@hoxu
Copy link
Author

hoxu commented Jan 10, 2015

With -c you need to quote the command flock passes to shell. I personally just use it without the -c parameter:

flock -n /tmp/foo.lockfile command param1 param2 etc

Perfect for potentially long-running jobs like backups :)

@lordsutch
Copy link
Collaborator

Added instructions to README.md. Thanks!

@hale
Copy link

hale commented Jan 12, 2015

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants