-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
192 lines (161 loc) · 7.72 KB
/
index.html
File metadata and controls
192 lines (161 loc) · 7.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PyBackup – Interactive Incremental Backup Tool | Bocaletto Luca</title>
<meta name="description" content="PyBackup is an all-in-one, interactive CLI utility for Linux. It provides incremental snapshots, GPG encryption, SHA256 checksums, automatic retention, interactive restore, exclude patterns, console & file logging, and optional email notifications.">
<meta name="keywords" content="incremental backup, CLI, GPG encryption, SHA256, tar.gz, pigz, retention, Linux backup, Python utility, PyBackup">
<meta name="author" content="Luca Bocaletto">
<style>
body { font-family: Arial, sans-serif; line-height: 1.6; padding: 20px; max-width: 900px; margin: auto; }
h1, h2, h3 { color: #333; }
nav ul { list-style: none; padding: 0; }
nav li { margin: 5px 0; }
pre { background: #f4f4f4; padding: 10px; overflow-x: auto; }
code { font-family: monospace; background: #f4f4f4; padding: 2px 4px; }
a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }
.btn { display: inline-block; margin: 10px 0; padding: 10px 15px; background: #24292e; color: #fff; border-radius: 5px; text-decoration: none; }
footer { margin-top: 40px; font-size: 0.9em; border-top: 1px solid #ddd; padding-top: 10px; }
</style>
</head>
<body>
<h1>PyBackup</h1>
<h3>for Linux By Bocaletto Luca</h3>
<p>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
<a href="#"><img src="https://img.shields.io/badge/version-1.0.0-green.svg" alt="Version 1.0.0"></a>
</p>
<a class="btn" href="https://github.com/bocaletto-luca/Backup-Linux" target="_blank">Source Code</a>
<nav>
<h2>Table of Contents</h2>
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#features">Features</a></li>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#configuration">Configuration</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#exclude-patterns">Exclude Patterns</a></li>
<li><a href="#logging">Logging</a></li>
<li><a href="#email-notifications">Email Notifications</a></li>
<li><a href="#backupignore-support">.backupignore Support</a></li>
<li><a href="#contributing">Contributing</a></li>
<li><a href="#license">License</a></li>
<li><a href="#author">Author</a></li>
</ul>
</nav>
<hr>
<h2 id="overview">Overview</h2>
<p><strong>PyBackup</strong> is an all-in-one, interactive CLI utility for Linux (Debian/Ubuntu). It provides:</p>
<ul>
<li>Incremental backups based on file modification times</li>
<li>Compressed archives (<code>.tar.gz</code>) or parallel compression with <code>pigz</code></li>
<li>GPG encryption of archives</li>
<li>SHA256 checksums for integrity verification</li>
<li>Automatic retention (rotation) of old backups</li>
<li>Interactive restore of encrypted backups</li>
<li>Persistent configuration stored in <code>~/.config/backup_main/config.json</code></li>
<li>Exclude patterns and <code>.backupignore</code> support</li>
<li>Console and rotating file logging</li>
<li>Optional email notifications on success or failure</li>
</ul>
<hr>
<h2 id="features">Features</h2>
<ul>
<li><strong>Interactive Menu</strong>: Configure, run backup and restore without memorizing flags</li>
<li><strong>Persistent Config</strong>: Settings saved in <code>~/.config/backup_main/config.json</code></li>
<li><strong>Incremental Snapshots</strong>: Only new or changed files are archived</li>
<li><strong>Compression Options</strong>: Native <code>tar.gz</code> or <code>pigz</code> if installed</li>
<li><strong>GPG Encryption</strong>: Secure archives with your GPG key</li>
<li><strong>Checksums</strong>: SHA256 record saved alongside each <code>.gpg</code> file</li>
<li><strong>Retention</strong>: Automatically delete backups older than configured days</li>
<li><strong>Restore</strong>: List and decrypt any backup to a target folder</li>
<li><strong>Exclude Patterns</strong>: Filter out files or directories by glob pattern</li>
<li><strong><code>.backupignore</code></strong>: Project-specific ignore rules</li>
<li><strong>Logging</strong>: Console output plus daily rotating log files</li>
<li><strong>Email Alerts</strong>: SMTP notifications for success or failure</li>
</ul>
<hr>
<h2 id="prerequisites">Prerequisites</h2>
<ul>
<li>Python 3.8+</li>
<li>GPG (<code>gnupg</code> command-line tool)</li>
<li>(Optional) <code>pigz</code> for parallel compression</li>
<li>An existing GPG key pair (public key on the machine for encryption)</li>
<li>SMTP server credentials for email notifications</li>
</ul>
<hr>
<h2 id="installation">Installation</h2>
<pre><code>git clone https://github.com/bocaletto-luca/Backup-Linux.git
cd Backup-Linux
pip install python-gnupg
chmod +x backup_main.py</code></pre>
<hr>
<h2 id="configuration">Configuration</h2>
<ol>
<li>Launch the script:<br><code>./backup_main.py</code></li>
<li>Select <strong>1) Configure settings</strong></li>
<li>Enter:
<ul>
<li><strong>Source directory</strong> (e.g. <code>/home/user/projects</code>)</li>
<li><strong>Backup directory</strong> (e.g. <code>~/backups</code>)</li>
<li><strong>GPG key ID</strong> (public key for encryption)</li>
<li><strong>Retention days</strong> (how long to keep backups)</li>
<li><strong>Exclude patterns</strong> (comma-separated)</li>
<li><strong>Log level</strong> (<code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>)</li>
<li><strong>SMTP settings</strong> for email alerts</li>
</ul>
</li>
<li>Configuration saved to <code>~/.config/backup_main/config.json</code></li>
</ol>
<hr>
<h2 id="usage">Usage</h2>
<h3>Run Backup</h3>
<ol>
<li>Select <strong>2) Run backup</strong></li>
<li>Script will perform incremental snapshot, compress, encrypt, checksum, rotate, log, email</li>
</ol>
<h3>Restore Archive</h3>
<ol>
<li>Select <strong>3) Restore archive</strong></li>
<li>Choose from list, specify target folder, decrypt and extract</li>
</ol>
<hr>
<h2 id="exclude-patterns">Exclude Patterns</h2>
<p>Use glob patterns to ignore files/folders. Place a <code>.backupignore</code> file in source directory:</p>
<pre><code>*.tmp
cache/</code></pre>
<hr>
<h2 id="logging">Logging</h2>
<ul>
<li><strong>Console</strong>: INFO/WARN/DEBUG</li>
<li><strong>File</strong>: <code>backup.log</code>, rotated daily</li>
</ul>
<hr>
<h2 id="email-notifications">Email Notifications</h2>
<p>SMTP credentials in config enable alerts on success/failure.</p>
<hr>
<h2 id="backupignore-support">.backupignore Support</h2>
<p>Define project-specific ignores in <code>.backupignore</code>.</p>
<hr>
<h2 id="contributing">Contributing</h2>
<p>Fork, branch, PR. Discuss major changes via issue first.</p>
<hr>
<h2 id="license">License</h2>
<p>MIT License – see <a href="LICENSE">LICENSE</a></p>
<hr>
<h2 id="author">Author</h2>
<p>Luca Bocaletto – <a href="https://bocaletto-luca.github.io">Website</a> |
<a href="https://github.com/bocaletto-luca">GitHub</a> |
<a href="https://bocalettoluca.altervista.org">Portfolio</a></p>
<footer>
© 2025 Luca Bocaletto · Licensed under GPL v3 ·
<a href="https://bocaletto-luca.github.io">Site</a> ·
<a href="https://github.com/bocaletto-luca">GitHub</a> ·
<a href="https://bocalettoluca.altervista.org">Portfolio</a>
</footer>
</body>
</html>
```