Download the PHP package itop/laravel-restic without Composer
On this page you can find all versions of the php package itop/laravel-restic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download itop/laravel-restic
More information about itop/laravel-restic
Files in itop/laravel-restic
Package laravel-restic
Short Description A Laravel package to backup your application
License MIT
Homepage https://github.com/itop-tm/laravel-restic
Informations about the package laravel-restic
Schedule your backup using laravel and restic
This package provides a class to help scheduling your backup using restic
Requirements
Go installation
Before using this package you have to install go and restic
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
If you have a previous version of Go installed, be sure to remove it before installing another.
Download the archive and extract it into /usr/local, creating a Go tree in /usr/local/go. For example, run the following as root or through sudo:
Add /usr/local/go/bin to the PATH environment variable. You can do this by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):
Note: Changes made to a profile file may not apply until the next time you log into your computer. To apply the changes immediately, just run the shell commands directly or execute them from the profile using a command such as source $HOME/.profile.
Verify that you've installed Go by opening a command prompt and typing the following command:
Confirm that the command prints the installed version of Go.
Restic installation
Restic is a backup program that is fast, efficient and secure. It supports the three major operating systems (Linux, macOS, Windows) and a few smaller ones (FreeBSD, OpenBSD).
Ubuntu
On Debian, there’s a package called restic which can be installed from the official repos, e.g. with apt-get:
From Source
In order to build restic from source, execute the following steps:
if you have problems reaching go modules and repositories try:
or
For other installation guides for Linux distributions or windows go Restic installation
Basic installation
You can install this package via composer using:
The package will automatically register its service provider.
To publish the config file to config/restic.php run:
This is the default contents of the configuration:
Configuring
This is the default contents of the configuration:
For pathing options to restic use env section in config file. Full environment variables that using restic listed here
Commands
Init
Before you start to backup your files you have to init your repositories specified in config/restic.php. The place where your backups will be saved is called a “repository”. All repositories specified in config/resic.php that you want to backup should be initiated separately
Backup
Now we’re ready to backup some data. The contents of a directory at a specific point in time is called a “snapshot” in restic. Run the following command for creating first snapshot.
If you run the backup command again, restic will create another snapshot of your data, but this time it’s even faster and no new data was added to the repository (since all data is already there). This is de-duplication at work!
for exclude files from backup you can path other options like:
if --exclude option is not passed will be used specified in config/restic.php or in env section
Snapshots
Now, you can list all the snapshots stored in the repository:
Forget
In order to remove the snapshots of local repository use the forget command and specify the snapshot ID on the command line:
Removing snapshots manually is tedious and error-prone, therefore restic allows specifying which snapshots should be removed automatically according to a policy. You can specify how many hourly, daily, weekly, monthly and yearly snapshots to keep, any other snapshots are removed.
Prune
After removing a snapshot the data that was referenced by files in that snapshot is still stored in the repository. To cleanup unreferenced data, the prune command must be run:
Every command also includes a "help" screen which displays and describes the command's available arguments and options. To view a help screen, precede the name of the command with help
Scheduling
See example of scheduling in App/Console/Kernel.php
All versions of laravel-restic with dependencies
illuminate/console Version ^5.8.15|^6.0|^7.0|^8.0
illuminate/contracts Version ^5.8.15|^6.0|^7.0|^8.0
illuminate/filesystem Version ^5.8.15|^6.0|^7.0|^8.0
illuminate/support Version ^5.8.15|^6.0|^7.0|^8.0
symfony/finder Version ^4.2|^5.0