Package: npbackup
NPBackupA secure and efficient file backup solution that fits both system administrators (CLI) and end users (GUI)Works on x64Linux,NASsolutions based on arm/arm64,Windowsx64 and x86 and MacOS X.FeaturesData deduplication and fast zstd compressionClient side data encryptionWide storage backend supportlocal filesSFTPHigh performance HTTP REST serverAmazon S3/Minio/WasabiBlackblaze B2Microsoft Azure Blob StorageGoogle Cloud StorageOpenStack SwiftAlibaba Cloud (Aliyun) Object Storage System (OSS)Resume on interrupted backupsFull CLI interface for scheduled task usageChecks for recent backups before launching a backupEnd User GUIBackups create, list, viewer and restoreFull configuration interfaceInternationalization support (en, fr as of feb 2023)PerformanceBackup process and IO priority settingsUpload / download speed limitsRemote connectivity concurrency settingsComes with full exclusion lists for Linux and WindowsFirst class prometheus supportRestic results metric generatioionGrafana dashboard includednode_exporter file collector supportOptional push gateway metrics uploadingFirst class Windows supportVSS snapshotsAutomatic cloud file exclusions (reparse points)Windows pre-built executablesWindows installerAdditional securityrepository uri / password, http metrics and upgrade server passwords are AES-256 encryptedEncrypted data viewing requires additional passwordAES-256 keys can't be guessed in executables thanks to Nuitka Commercial compilerEasy configuration via YAML file (or via GUI)Remote automatic self upgrade capacityIncluded upgrade server ready to run in productionAboutSo, a new backup solution out of nowhere, packed with too much features for it's own good ? Not really !NPBackup relies on the well knownresticbackup program, which has been battle proven for years.
While restic is a fanstastic program, NPBackup expands restic by offering a wider set of features.QuickstartYou may install npbackup via PyPI or use the pre-built executables.Prebuilt executablesOn linux, copynpbackupexecutable to/usr/local/binand make it executable viachmod +x /usr/local/bin/npbackup. Any distribution with glibc >= 2.17 should do.On Windows, you can directly executenpbackup.exeor useNPBackupInstaller.exeto install NPBackup into program files and create a run schedule.
The x64 binary is compatible with Windows 10+. The x86 binary is compatible with windows Vista and higher. On those old systems, you might need to install Visual C runtime 2015.PyPI installationIf you don't want to use the pre-built executables, you can install via pip withpip install npbackup.Python requirement: 3.6+Note that if you want to use the GUI, you'll also need to install tkinter viayum install python-tkinterorapt install python3-tk.SetupCopy the example config from modelexamples/npbackup.conf.distinto the directory where npbackup is installed.Also copy theexcludesdirectory if you plan to use the prefilled bigger exclusion lists for your backups.You can adjust the parameters directly in the file, or via a config GUI by launchingnpbackup --config-file=npbackup.conf --config-guiOnce configured, you can launch manual backups vianpbackup --backup. Those can be scheduled.
Windows schedule is created automatically by the installer program. On Linux, you'll have to create a cronjob or a systemd timer.Since NPBackup is configured to only proceed with backups when no recent backups are detected, you should consider scheduling npbackup executions quite often.
The default schedule should be somewhere around 15 minutes.You can usenpbackup --listor the GUI to list backups.The GUI allows an end user to check current backups & restore files.rom backups:The YAML configuration file encrypts sensible data so the end user doesn't have to know repository URI or password.Quickstart GUIJust run the npbackup executable and configure it.
Prebuilt binaries can be foundhereMain minimalistic interface allows to:List current backupsLaunch a manual backupSee if last backup is recent enoughRestore window allows to browse through backups and select what files to restore.Configuration allows to edit the YAML configuration files directly as end userBackup process is interactive when GUI is usedSecurityNPBackup' security model relies on symmetric encryption of all sensible data that allows to access a repository.In order to achieve this, NPBackup contains an AES-KEY that can be set:at compile timeat run time via an AES-KEY filePlease note that right clicking on "" in the configuration GUI will allow to decrypt that data, by prompting a backup admin password.
That password is set at compile-time and should be different depending on the organization.This allows a system admin to see repo URI and passwords, without leaving this information available on the computer.The configuration file should never be world readable, as one could change the backup admin password, allowing to decrypt other parts of the conf file.The difficulty of laptop backupsAs a matter of fact, laptop backups are the hardest. No one can predict when a laptop is on, and if it has access to internet.
Creating a backup strategy in those cases isn't a simple task.NPBackup solves this by checking every 15 minutes if a backup newer than 24h exists.
If so, nothing is done. In the case no recent backup exists, a backup is immediately launched.
OF course, both time options are configurable.
In order to avoid sluggish user experience while backing up, process and io priority can be lowered.
Once done, NPBackup can send backup results in Prometheus format directly to a push gateway, for prometheus to catch them.A good server backup solutionServer backups can be achieved by setting up a scheduled task / cron job.Of course, since NPBackup supports pre-exec and post-exec commands, it can be used to backup various services like virtual hosts or databases where snapshot/dump operations are required.
When run on a server, prometheus support can be shifted from a push gateway to a file, which will be picked up by node_exporter file collector.:MonitoringNPBackup includes full prometheus support, including grafana dashboard.
On servers, we'll configure a prometheus file that gets written on each backup, and later can be collected by node_exporter.On laptops, since we might be away from our usual network, we'll push the backup metrics to a remote push gateway which laters gets collected by prometheus itself.The current NPBackup dashboard:End user expericenceWhile admin user experience is important, NPBackup also offers a GUI for end user experience, allowing to list all backup contents, navigate and restore files, without the need of an admin. The end user can also check if they have a recent backup completed, and launch backups manually if needed.SecurityNPBackup inherits all security measures of it's backup backend (currently restic with AES-256 client side encryption including metadata), append only mode REST server backend.On top of those, NPBackup itself encrypts sensible information like the repo uri and password, as well as the metrics http username and password.This ensures that end users can restore data without the need to know any password, without compromising a secret. Note that in order to use this function, one needs to use the compiled version of NPBackup, so AES-256 keys are never exposed. Internally, NPBackup never directly uses the AES-256 key, so even a memory dump won't be enough to get the key.Upgrade serverNPBackup comes with integrated auto upgrade function that will run regardless of program failures, in order to lessen the maintenance burden.The upgrade server runs a python asgi web server with integrated HTTP basic authentication, that can further be put behind an SSL proxy like HaProxy.CompilationIn order to fully protect the AES key that is needed to support NPBackup, one can compile the program with Nuitka.
Compiling needs restic binary for the target platform inRESTIC_SOURCE_FILESfolder, files must be namedrestic_{version}_{platform}_{arch}[.extension]like provided by restic.net orgithubLinux binaries need to be made executable in theRESTIC_SOURCE_FILESfolder.You'll need to change the default AES key insecrets.py, see the documentation in the file itself.Compile options are available incompile.py.We maintain a special 32 bit binary for Windows 7 which allows to backup those old machines until they get replaced.We also compile our linux target on RHEL 7 in order to be compatible with reasonably old distributions (>= glibc 2.17).arm and arm64 builds are compiled on Debian stretch for use with glibc > 2.24.
Additionnaly, arm builds are compiled without GUI support since they're supposed to fit on smaller devices like NAS / Raspberries.Smart shield, antivirus and reputationOfficial binaries for Windows provided by NetInvent are signed with a certificate, allowing to gain trust and reputation in antivirus analysis.Also, official binaries are compiled using Nuitka Commercial grade, which is more secure in storing secrets.Pre-compiled builds for Windows have been code signed with NetInvent's EV certificate, usingwindows_tools.signtoolSigning on a Windows machine with Windows SDK installed:from windows_tools.signtool import SignTool
signer = SignTool()
signer.sign(r"c:\path\to\executable", bitness=64)MiscNPBackup supports internationalization and automatically detects system's locale.
Still, locale can be overrided via an environment variable, eg on Linux:export NPBACKUP_LOCALE=enOn Windows:set NPBACKUP_LOCALE=enSpecial thanksThanks to the Restic Team without which this program would not be possibleThanks tohttps://github.com/Krutyi-4elwho packaged i18nice internationalization for usSpecial thanks to the BTS SIO 2nd year class of 2022 at Lycee Marillac / Perpignan who volunteered as GUI Q&A team