Skip to content

Commit e797291

Browse files
committed
Update server script
1 parent 6c42a2c commit e797291

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
3-
41
# Automated Server Backups!
52

63
### The Mission
@@ -272,6 +269,38 @@ Some webhoster only let you trigger jobs via an UI. If so, they won't accept you
272269

273270
In the webhoster's interface you can then just trigger the `backup-cron.sh` file.
274271
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+
275304
## Thoughts:
276305

277306
- Currently we are generating the file names for our server backup with

0 commit comments

Comments
 (0)