annotate backup/macos/luanBackup.sh @ 1793:a55a891a4f67

xml minor
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 28 Dec 2023 11:36:24 -0700
parents 077366d117bb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1694
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
1 #!/bin/bash
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
2
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
3 BKP=/Volumes/External/luanBackup
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
4 DIR=/Users/administrator/luan/backup
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
5
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
6 function bkp_machine() {
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
7 mkdir -p $BKP 2>/dev/null;
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
8
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
9 rm -f `find $BKP/ -name '*.tgz' -mmin +4000`;
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
10
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
11 cd $DIR;
1699
e6750146faa1 no restart on backup
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 1694
diff changeset
12 rm -rf backups.copy;
1701
077366d117bb use local luan
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 1700
diff changeset
13 ./luan.sh copy_backups.luan
1699
e6750146faa1 no restart on backup
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 1694
diff changeset
14 tar czvf /Volumes/External/luanBackup/$(date +"backup%Y%m%d%H%M").tgz backups.copy;
1694
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
15 }
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
16
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
17 sleep 60;
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
18 bkp_machine;
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
19
09aaca079ff3 add backup script
Vadim Filimonov <fffilimonov@yandex.ru>
parents:
diff changeset
20 sleep 3600;