You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-3Lines changed: 32 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,3 @@
1
-
2
-
3
-
4
1
# Automated Server Backups!
5
2
6
3
### The Mission
@@ -272,6 +269,38 @@ Some webhoster only let you trigger jobs via an UI. If so, they won't accept you
272
269
273
270
In the webhoster's interface you can then just trigger the `backup-cron.sh` file.
274
271
272
+
### Download alternatives
273
+
When it's still on the same machine, it isn't a backup. So here are some approaches how to download the backup. These cmd could also be executed on a remote machine with crontabs.
274
+
275
+
#### Download with rsync
276
+
277
+
```bash
278
+
# syncs everything from backups to local-backups
279
+
$ rsync -a -v root@111.222.333.444:backups/ local-backups/
280
+
```
281
+
282
+
#### Only download the latest file(s) with scp
283
+
284
+
```bash
285
+
286
+
# create server var
287
+
$ server=root@111.222.333.444
288
+
289
+
# folder destination (server)
290
+
$ from=/backups
291
+
292
+
# folder to store backup
293
+
$ to=local-backups
294
+
295
+
# download only latest 2 files (latest two, because it's the backup and db export)
296
+
$ scp $server:$from/$(ssh $server"ls -t $from | head -2")$to
297
+
```
298
+
299
+
#### Download with SFTP
300
+
301
+
`$ sftp root@111.222.333.444`
302
+
`get -r backups local-backups`
303
+
275
304
## Thoughts:
276
305
277
306
- Currently we are generating the file names for our server backup with
0 commit comments