Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A wrapper script for Restic backup software that inits, creates, prunes and checks backups
runrestic is a simple Python wrapper script for the Restic backup software that initiates a backup, prunes any old backups according to a retention policy, and validates backups for consistency. The script supports specifying your settings in a declarative configuration file rather than having to put them all on the command-line, and handles common errors.
repositories = [
"/tmp/restic-repo",
"sftp:user@host:/srv/restic-repo",
"s3:s3.amazonaws.com/bucket_name"
]
[environment]
RESTIC_PASSWORD = "CHANGEME"
[backup]
sources = [
"/home",
"/var"
]
[prune]
keep-last = 3
keep-hourly = 5
Alternatively you can also just use JSON. For a more comprehensive example see the example.toml or check the schema.json
To install runrestic, run the following command to download and install it:
sudo pip3 install --upgrade runrestic
Once you have restic
and runrestic
ready, you should put a config file in on of the scanned locations, namely:
Afterwards, run
runrestic init # to initialize all the repos in `repositories`
runrestic # without actions will do: runrestic backup prune check
# or
runrestic [action]
If, however, you need to pass along arbitrary other flags you can now add them to the end of your runrestic
call like so:
runrestic backup -- --one-file-system
The output of restic
and the configured pre/post-hooks is added to the runrestic
logs at the level defined in
[execution] proc_log_level
(default: DEBUG), which can be overwritten with the CLI option -p/--proc-log-level
.
For process log levels greater than INFO
the output of file names is suppressed and for log levels greater than WARNING
restic
is executed with the --quiet
option. If the process log level is set to DEBUG
, then restic is executed
with the --verbose
option.
It is also possible to add restic
progress messages to the logs by using the CLI option --show-progress INTERVAL
where the INTERVAL
is the number of seconds between the progress messages.
To use the options defined in runrestic
with restic
(e.g. for a backup restore), you can use the shell
action:
runrestic shell
If you are using multiple repositories or configurations, you can select one now.
@d-matt created a nice dashboard for Grafana here: https://grafana.com/grafana/dashboards/11064/revisions
If you want to run runrestic automatically, say once a day, the you can configure a job runner to invoke it periodically.
If you're using systemd instead of cron to run jobs, download the sample systemd service file and the sample systemd timer file. Then, from the directory where you downloaded them:
sudo mv runrestic.service runrestic.timer /etc/systemd/system/
sudo systemctl enable runrestic.timer
sudo systemctl start runrestic.timer
If you're using cron, download the sample cron file. Then, from the directory where you downloaded it:
sudo mv runrestic /etc/cron.d/runrestic
sudo chmod +x /etc/cron.d/runrestic
v0.5.28
v0.5.27
v0.5.26
restic
and pre/post-hook commands to runrestic logs.--show-progress INTERVAL
for the restic progress update interval in seconds (default None)v0.5.25
v0.5.24
v0.5.23
v0.5.21
v0.5! Expect breaking changes.
parallel
and retry_*
options.@tabic wrote an ansible role, you can find it here: https://github.com/outwire/ansible-role-restic . (I have neither checked nor tested it.)
This project is managed with poetry
Install it if not already present:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
# or
pip install --user poetry
poetry install
poetry run pytest
The project contains a .devcontainer
folder with the settings for VScode to develop inside container. The Python virtual environment
created by poetry is stored outside the container in the projects path .virtualenvs
so that it survives container rebuilds.
The Ubuntu 22.04 based container uses Python 3.10 as system version and includes minimal Python 3.7, 3.8 and 3.9 versions for creating virtual environments in any of those versions.
It is possible to switch the Python version used by poetry
with the command poetry use <version>
,
see poetry managing environments for more details.
This project was initially based on borgmatic but has since evolved into something else.
FAQs
A wrapper script for Restic backup software that inits, creates, prunes and checks backups
We found that runrestic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.