annotate backup/macos/luanBackup.sh @ 1699:e6750146faa1

no restart on backup
author Vadim Filimonov <fffilimonov@yandex.ru>
date Tue, 28 Jun 2022 16:13:37 +0300
parents 09aaca079ff3
children 47302bc83b2e
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;
e6750146faa1 no restart on backup
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 1694
diff changeset
13 luan copy_backups.luan
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;