mongoshield run
Run the scheduled job once: lock, back up, verify, prune, notify.
mongoshield run [options]Does what mongoshield schedule does on each tick, once, using the schedule, retention, guard, notify and heartbeat sections of mongoshield.config.ts. Made for system cron, Kubernetes CronJobs, CI and serverless schedulers. Exits 0 when another runner holds the lock (the run is skipped).
Options
Section titled “Options”| Option | Description |
|---|---|
--uri <mongodb-uri> | Connection string (default: config source.uri, MONGOSHIELD_URI or MONGODB_URI). |
--to <storage-url> | Where backups are stored: ./dir, file:///abs, s3://bucket/prefix (default: config). |
--identity-file <path> | age identity file for encrypted backups (from mongoshield keygen). Repeatable. |
--passphrase-env <VAR> | Read the encryption passphrase from this environment variable. |
--verify <none|fast|deep|drill> | Override schedule.verify (default: fast; drill needs the drill section). |
--no-prune | Do not prune, whatever schedule.prune says. |
--jitter | Wait a random 0–schedule.jitterSeconds before starting. |
The global options (--config, --json, --quiet,
--verbose, --no-color, --yes) work here too.
Examples
Section titled “Examples”Run the configured job now:
mongoshield runFrom crontab, every night at 03:15, with a deep verify:
15 3 * * * mongoshield run --verify deep --quietMongoShield is MIT licensed and is not affiliated with, endorsed by or sponsored by MongoDB, Inc. MongoDB is a trademark of MongoDB, Inc.Privacy policy