1
- Python Incremental Backup Scripts
1
+ Python Backup Scripts
2
2
=============
3
3
4
4
Python scripts for incremental backups of servers. This includes filesystem
5
- backup and mysql backup .
5
+ backups and mysql backups .
6
6
7
-
8
- Filesystem Backups
7
+ Pulled Backups
9
8
===========
10
- Filesystem backups are done through the incrbackup script.
9
+ Pulled filesystem backups are done through the incrbackup.py script. Backups
10
+ are pulled down from remote systems to the backup server for security, the
11
+ backup server can get to the remote systems being backed up but not vice versa.
12
+ Hence if a remote system is compromised the backup server isn't.
11
13
12
- Filesystem backups use rsync and hard links to keep multiple copies of one or
14
+ Pulled backups use rsync and hard links to keep multiple copies of one or
13
15
more filesystems while using minimal space. If backing up remote
14
16
servers this script assumes that the proper ssh keys have been setup from the
15
17
backup server hosting this script to the servers being backed up.
16
18
17
- A pid file is placed into the system temp directory to prevent concurrent
18
- backups from running at once. The script provides options for the number of
19
- backups to keep. After the max number of backups is reached, backups are
20
- deleted starting with the oldest backup first.
21
-
22
19
Backup paths can be either local or remote. The backup directory where
23
20
the backups are stored must be local and must already exist. If a users isn't
24
21
specified then the remote user used by ssh for rsync is considered to be a
25
22
user named backup.
26
23
27
24
Use the -h or the --help flag to get a listing of options.
28
25
29
- incremental_backup .py [-hnksftu ]
26
+ incrbackup .py [-hnksctu ]
30
27
[-h | --help] prints this help and usage message
31
28
[-n | --name] backup namespace
32
29
[-k | --keep] number of backups to keep before deleting
33
30
[-s | --server] the server to backup, if remote
34
- [-f | --config] configuration file with backup paths
31
+ [-c | --config] configuration file with backup paths
35
32
[-t | --store] directory locally to store the backups
36
33
[-u | --user] the remote username used to ssh for backups
37
34
@@ -56,9 +53,38 @@ Usually the backup scripts are run from a remote, off-site, server pulling down
56
53
content from the servers to backup. Scripts are usually setup to run from cron
57
54
periodically.
58
55
56
+
57
+ Pushed Filesystem Backups
58
+ ===========
59
+ Pushed filesystem backups are done through the pushbackup.py script.
60
+
61
+ his is an incremental backup system that pushes to a remote server. Useful
62
+ for remote systems that aren't always on (laptops). Backups use rsync and hard
63
+ links to keep multiple full copies while using minimal space. It is assumed
64
+ that the rotatebackups.py script exists on the remote backup server and that
65
+ the proper ssh keys have been setup from the pushing server to the backup
66
+ server.
67
+
68
+ Use the -h or the --help flag to get a listing of options.
69
+
70
+ pushbackup.py [-hnksctuxr]
71
+ [-h | --help] prints this help and usage message
72
+ [-n | --name] backup namespace
73
+ [-k | --keep] number of backups to keep before deleting
74
+ [-s | --server] the server to push to backup to
75
+ [-c | --config] configuration file with backup paths
76
+ [-t | --store] directory locally to store the backups
77
+ [-u | --user] the remote username used to ssh for backups
78
+ [-x | --ssh-key] the ssh key used to connect to the backup
79
+ [-r | --rotate-script] the rotatebackups script remote location
80
+
81
+ Pushed backup use the same config format as pulled backups. Pushed backups are
82
+ usually run manually when needed. They should not be used to backup servers due
83
+ to security reasons. If backing up server filesystem see pulled backups.
84
+
59
85
MySQL Backups
60
86
===========
61
- MySQL backups are done through the mysqlbackup script.
87
+ MySQL backups are done through the mysqlbackup.py script.
62
88
63
89
A pid file is placed into the system temp directory to prevent concurrent
64
90
backups from running at once. The script provides options for the number of
@@ -67,13 +93,17 @@ deleted starting with the oldest backup first.
67
93
68
94
Use the -h or the --help flag to get a listing of options.
69
95
70
- mysqlback [-hnkdbus ]
96
+ mysqlbackup.py [-hkdbups ]
71
97
[-h | --help] prints this help and usage message
72
98
[-k | --keep] number of backups to keep before deleting
73
99
[-d | --databases] a comma separated list of databases
74
- [-b | --backup-root ] directory locally to store the backups
100
+ [-t | --store ] directory locally to store the backups
75
101
[-u | --user] the database user
76
102
[-p | --password] the database password
77
103
[-s | --host] the database server hostname
78
104
79
- Please feel free to send any improvements or bug fixes.
105
+ License and Bug Fixes
106
+ ===========
107
+ These works are public domain or licensed under the Apache Licene. You can do
108
+ anything you want with them. Please feel free to send any improvements or
109
+ bug fixes.
0 commit comments