All Projects → zevilz → WebServerCloudBackups

zevilz / WebServerCloudBackups

Licence: MIT License
Automatic backups your web projects bases and files to the clouds via WebDAV.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to WebServerCloudBackups

Sftpgo
Fully featured and highly configurable SFTP server with optional HTTP, FTP/S and WebDAV support - S3, Google Cloud Storage, Azure Blob
Stars: ✭ 3,534 (+17570%)
Mutual labels:  s3, webdav
backmeup
BackMeUp: An automated MySQL / MariaDB databases and files backup solution on *nix Machines using Amazon S3, WebDAV (ownCloud / NextCloud etc.), Google Drive and Dropbox.
Stars: ✭ 80 (+300%)
Mutual labels:  webdav, backup-files
Wal E
Continuous Archiving for Postgres
Stars: ✭ 3,313 (+16465%)
Mutual labels:  backups, s3
Rclone
"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Yandex Files
Stars: ✭ 30,541 (+152605%)
Mutual labels:  s3, webdav
cassandra-CQL-exporter
A highly configurable utility to export whole Apache Cassandra keyspace or table structure/data to CQL scripts.
Stars: ✭ 19 (-5%)
Mutual labels:  backup-script, backup-database
Winscp
WinSCP is a popular free SFTP and FTP client for Windows, a powerful file manager that will improve your productivity. It supports also Amazon S3, FTPS, SCP and WebDAV protocols. Power users can automate WinSCP using .NET assembly.
Stars: ✭ 794 (+3870%)
Mutual labels:  s3, webdav
VestaCP-Sync-Backups-To-Mega
VestaCP: uploading backups to the MEGA cloud
Stars: ✭ 17 (-15%)
Mutual labels:  backups, backup-script
spring-file-storage-service
The FSS(file storage service) APIs make storing the blob file easy and simple .
Stars: ✭ 33 (+65%)
Mutual labels:  s3, webdav
awesome-storage
A curated list of storage open source tools. Backups, redundancy, sharing, distribution, encryption, etc.
Stars: ✭ 324 (+1520%)
Mutual labels:  s3, s3-backup
go-drive
A simple cloud drive mapping web app supports local, FTP/SFTP, S3, OneDrive, WebDAV, Google Drive.
Stars: ✭ 184 (+820%)
Mutual labels:  s3, webdav
Filestash
🦄 A modern web client for SFTP, S3, FTP, WebDAV, Git, Minio, LDAP, CalDAV, CardDAV, Mysql, Backblaze, ...
Stars: ✭ 5,231 (+26055%)
Mutual labels:  s3, webdav
minio-rclone-webdav-server
A @rclone served WebDAV server with @minio as the s3 storage backend docker example
Stars: ✭ 17 (-15%)
Mutual labels:  s3, webdav
Kodexplorer
A web based file manager,web IDE / browser based code editor
Stars: ✭ 5,490 (+27350%)
Mutual labels:  s3, webdav
Cyberduck
Cyberduck is a libre FTP, SFTP, WebDAV, Amazon S3, Backblaze B2, Microsoft Azure & OneDrive and OpenStack Swift file transfer client for Mac and Windows.
Stars: ✭ 1,080 (+5300%)
Mutual labels:  s3, webdav
s3-mongo-backup
Mongodb backups to S3
Stars: ✭ 18 (-10%)
Mutual labels:  s3, backup-script
mindav
A self-hosted file backup server which bridges WebDAV protocol with @minio written in @totoval. Webdav ❤️ Minio
Stars: ✭ 64 (+220%)
Mutual labels:  s3, webdav
bash-backup
Simple backup script for GNU/Linux servers
Stars: ✭ 76 (+280%)
Mutual labels:  backups, backup-script
gitlab-mattermost-backup
A simple backup script for mattermost in gitlab omnibus package
Stars: ✭ 23 (+15%)
Mutual labels:  s3, backup-script
radio
Redundant Array of Distributed Independent Objectstores in short RADIO performs synchronous mirroring, erasure coding across multiple object stores
Stars: ✭ 25 (+25%)
Mutual labels:  s3
laravel-s3-tools
This Laravel package contains additional functionality not currently in Laravel for interfacing with Amazon's S3 service (including managing versioned objects).
Stars: ✭ 31 (+55%)
Mutual labels:  s3

WebServerCloudBackups Version Donate

Automatic backups your web projects bases (MySQL/MariaDB) and files to the clouds via WebDAV or Amazon S3. Supports setting passwords for archives and excluding specified folders.

Requirements

  • curl (for WebDAV)
  • s3cmd (for S3)
  • 7zip archiver (usually p7zip-rar p7zip-full on deb-based distros)

Configuring

  1. Login server in root user

  2. Copy backup.sh and backup.conf to other directory on your server.

  3. Change permissions of backup.conf to 600.

  4. Declare main vars in backup.conf

  • MYSQL_USER - MySQL/MariaDB user (min user privileges: EVENT,LOCK TABLES,SELECT,SHOW DATABASES on all databases);
  • MYSQL_PASS - MySQL/MariaDB user password;
  • CLOUD_USER - login for your cloud (for WebDAV);
  • CLOUD_PASS - password for your cloud user (for WebDAV);
  • CLOUD_PATH - full path to cloud folder for WebDAV (ex.: https://webdav.yandex.ru/Backups/) or path to S3 spacename (ex.: s3://myspacename)
  • CLOUD_PROTO - cloud protocol (webdav or s3, default value is webdav if empty or undefined)
  • TMP_PATH - path for temporary files on server (ex.: /tmp/)
  • GLOBAL_ARCHIVE_PASS - global password for created archives (if project password set to false it will be used this password. if project password set to false and this password set to false password not set to project archive.)
  • EXCLUDE - spaces separated folders to exclude (supports wildcard in folders names, ex.: EXCLUDE=".svn .git *cache*")
  • EXCLUDE_RELATIVE - relative folders paths to exclude separated by spaces (supports wildcard in paths to folders, ex.: EXCLUDE_RELATIVE="wp-content/cache templates/*_temp")
  • <PERIOD>_EXCLUDE - spaces separated folders to exclude for specific backup period (ex.: DAILY_EXCLUDE="uploads")
  • <PERIOD>_EXCLUDE_RELATIVE - relative folders paths to exclude separated by spaces for specific backup period (ex.: WEEKLY_EXCLUDE_RELATIVE="wp-content/uploads")
  • SPLIT - size of archive parts (set false if you don't want split archives into parts); supports b (bytes), k (kilobytes) m (megabytes) g (gigabytes) (ex.: SPLIT="500m")
  • LAST_BACKUPS_PATH - folder for lists of last backup files (script use its for deleting old files from cloud to avoid errors and unnecessary files with splitting archives into parts; folder create automatically; this folder is in the same folder as the main script with name last_backups if this var not set)
  1. Add your projects after declare -A projects one per row like below:
projects[unique_key]="<project_name> <db_name> <project_folder> <project_archive_password>"

Example:

projects[1]="domain.org false /home/user/www/domain.org false"
projects[2]="domain.com com_db /home/user/www/domain.com 1234"

Parameters in quotes must be written through spaces and all required.

Parameters:

  • project name (you must create folder with same name in the cloud folder, defined in CLOUD_PATH)
  • database name (type false if database backup is not required for project)
  • full path to project folder (type false if files backup is not required for project)
  • project archive password (type false if password is not required for project archive or using global password, defined in GLOBAL_ARCHIVE_PASS)

Usage

Directly in shell

bash backup.sh <backup_type> <period> <compress_ratio>

Compression ratio parameter is opional. It sets to 5 if it not set.

Example:

bash backup.sh bases daily 7

Supported backup types:

  • files - backup projects folder
  • bases - backup projects bases

Supported periods:

  • hourly - add "hourly" mark and current hour to archive name (ex.: domain.com_base_hourly_02.7z)
  • daily - add number and name of the current week day to archive name (ex.: domain.com_files_5_Friday.7z)
  • weekly - add "weekly" mark to archive name (ex.: domain.com_files_weekly.7z)
  • monthly - add "monthly" mark to archive name (ex.: domain.com_files_monthly.7z)

Supported compress ratio:

  • 0 - without compression
  • 1 - fastest
  • 3 - fast
  • 5 - normal (default)
  • 7 - maximum
  • 9 - ultra

Better compression ratios with big files can lead to fails. if at an archiving there is a fails that it is necessary to lower compression ratio.

Cron

Add lines in root crontab like below

10 * * * * /bin/bash /path/to/script/backup.sh bases hourly # bases backup every hour in 10 minutes
0 0 * * * /bin/bash /path/to/script/backup.sh bases daily # bases backup every day in 00:00
20 0 * * 1 /bin/bash /path/to/script/backup.sh bases weekly # bases backup every monday in 00:20
40 0 1 * * /bin/bash /path/to/script/backup.sh bases monthly # bases backup every 1st day every month in 00:40
0 1 * * 1 /bin/bash /path/to/script/backup.sh files weekly 7 # files backup every monday in 01:00 with changed compression ratio
0 4 1 * * /bin/bash /path/to/script/backup.sh files monthly 7 # files backup every 1st day every month in 04:00 with changed compression ratio

If you want receive script result to email add below to the top of crontab list (require working MTA on your server)

Tested on

  • Hetzner Storage Box (WebDav)
  • Yandex Disk (WebDav, not recommended for big files)
  • Mail.ru Cloud (WebDav)
  • DigitalOcean Spaces (S3)

TODO

  • add support for others database types backup
  • add support for partitioning archives into specified size
  • add automatically checking/creating folders in cloud
  • add logging with rotation
  • validating vars from config file
  • add full support for some special characters, spaces and non latin characters in file names and paths
  • add ability to backup files and databases to own archive
  • add functionality for restore from backups
  • add support for local backup to mounted clouds disks
  • add support for backups via rsync
  • make package with system daemon and flexible backups customization

Changelog

  • 17.12.2020 - 1.6.1 - fixed archive filename for hourly backup period
  • 13.12.2020 - 1.6.0 - added hourly backup period
  • 29.07.2020 - 1.5.0 - added parameters for excluding folders for specific backup periods
  • 17.04.2020 - 1.4.1 - removed "--databases" parameter in mysqldump command for support restore databases to another databases
  • 23.11.2019 - 1.4.0 - added support for S3 storages
  • 24.10.2019 - 1.3.2 - bug fixes
  • 23.10.2019 - 1.3.1 - hidden curl success messages for clean output
  • 18.02.2019 - 1.3.0 - added support for sets user for databases backups instead using root user
  • 01.03.2018 - 1.2.1 - bug fixes
  • 22.02.2018 - 1.2.0 - added support for partitioning archives into specified size, automatically checking/creating folders in cloud, automatically remove slashes in the end of paths in vars to avoid errors, small code refactoring
  • 20.02.2018 - 1.1.0 - added support for excluding folders when archiving, small code refactoring, added new vars to config file
  • 14.05.2017 - 1.0.2 - added compress ratio parameter
  • 13.05.2017 - 1.0.1 - main script code refactoring
  • 11.05.2017 - 1.0.0 - released
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].