This function backups a list of folders into S3. It requires that you:
install the AWS CLI;
configure a profile in file ~/.aws/credentials;
create an s3 bucket where the profile can read/write into;
create a yaml file containing the list of folders for backup.
Optionally it's possible to define file/folder/pattern exclusions.
To avoid concurrent cronjobs I implemented a PIDfile-based method
(checks if last PID is still active; if yes, do nothing; if not, execute).
1 2 3 | backup_to_s3(bucket, root_folder, profile, dryrun = T,
folders_file = "~/.folders_to_backup.yml",
exclusions_file = "~/.exclusions_from_backup.yml")
|
bucket |
Is the name of the s3 bucket where the backup is stored. |
root_folder |
Is the name of the root folder where the backup
is stored. |
profile |
Is a profile name contained in ~/.aws/credentials. |
dryrun |
When equal to T doesn't backup. Only does simulation. |
folders_file |
Is the path of the file that contains the folders to backup. By default is ~/.folders_to_backup.yml. Example file in folder inst/config. |
exclusions_file |
is the path of the file (if applicable) that contains the folders or patterns to exclude from the backup. By default is ~/.exclusions_from_backup.yml. Example file in folder inst/config. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.