Comments (5)
Yeah I would generally lean towards option 1 but am also worried about possible overlap of backup runs. Specifically I would worry when one instance told the server to resume file saves while the second was still archiving content.
I agree with the thought and challenge with a lock.
Ultimately I'm thinking this has to be a fairly common need and might be worth an enhancement to the backup script. I could see the user facing options being
- Enable interleaved backup types, where it's always local/tar + plus the usual type selection
- Frequency of remote upgrades where the user specifies in addition to every N local backup do the selected remote backup
If you're interested in PR'ing that, then that would be great. Otherwise I can queue it up, but might be a little while before I can get to it.
from docker-mc-backup.
I'll take a look at doing a PR with these features but I would lean towards a lockfile, it could have the container's ID in it which could be compared.
We can easily get the ID by cat /etc/hostname
. Then store that in the lockfile. It does annoyingly open an attack surface if the backup container is compromised but I can't see how it would be. Or provide the option to have the lockfile elsewhere?
Would love to hear your thoughts.
from docker-mc-backup.
If lockfile usage is optional (off by default), then I am fine with that approach. My general concern was forcing users to declare a whole volume (which might be a cloud block storage volume) for one lockfile. In fact, the option could be a declaration of the path to a lockfile to create/coordinate the backups and then users can choose any volume path they want.
from docker-mc-backup.
What do you think to the following:
The user if they wanted to support multiple backups would define the following variable:
ENABLE_LOCKFILE
As well as defining a lockfile location; it may be a centralised place rather than the directory, it doesn't matter hugely where it is stored as long as all the containers have access to it. You could store it where the server is but then you'd have to give write permissions to that directory.
Which if enabled would fire the following steps:
flowchart TD
begin([Start if ENABLE_LOCKFILE variable is set])
fileExists{Does the Lockfile exist?}
fileDoesExist(Wait a small amount of time)
fileDoesntExist(Create Lockfile)
startBackup([Begin the backup process])
deleteLockfile(Delete the Lockfile)
begin-->fileExists
fileExists--Yes-->fileDoesExist-->fileExists
fileExists--No-->fileDoesntExist-->startBackup-->deleteLockfile
I'm not sure if you would even need to write the container id into the lockfile. Try to keep it as simple as possible.
from docker-mc-backup.
Overall that looks great. I'd suggest collapsing the enable/location variables into one.
Agreed, the content of the lock file becomes non-important. Container ID might still be good for debugging.
from docker-mc-backup.
Related Issues (20)
- mc-backup fails to connect to RCON and terminates the container HOT 4
- Option to create specified directory HOT 1
- Unable to connect to RCON on unRAID server HOT 2
- Add support for configuring rclone retries in backup container HOT 1
- Add chron time schedule for backups HOT 3
- Provide option to customize included directories, such as just world directory HOT 1
- Allow for excludes to be blank
- Split to multiple files HOT 4
- Is it possible that excluding files of type .jar could potentially lead to unexpected issues? HOT 2
- Rclone only prune local HOT 8
- Error querying the server after upgrade to 1.20.4 HOT 2
- rsync doesn't prune HOT 1
- Error querying the server when using authentication mod HOT 1
- [Bug] `rsync` is deleting the backup right after creating it HOT 8
- rsync is not pruning all directories HOT 8
- Support different query and RCON addresses HOT 1
- Incompatability with Lazytainer HOT 2
- Wrong permissions on level.dat HOT 8
- Restore backup container leaves zombie process HOT 1
- tar method does not prune old files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-mc-backup.