diff backup/macos/luanBackup.sh @ 1694:09aaca079ff3

add backup script
author Vadim Filimonov <fffilimonov@yandex.ru>
date Mon, 20 Jun 2022 11:12:25 +0300
parents
children e6750146faa1
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/backup/macos/luanBackup.sh	Mon Jun 20 11:12:25 2022 +0300
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+BKP=/Volumes/External/luanBackup
+DIR=/Users/administrator/luan/backup
+
+function bkp_machine() {
+  mkdir -p $BKP 2>/dev/null;
+
+  rm -f `find $BKP/ -name '*.tgz' -mmin +4000`;
+
+  cd $DIR;
+  ./stop.sh
+  tar czvf /Volumes/External/luanBackup/$(date +"backup%Y%m%d%H%M").tgz backups;
+  ./start.sh
+}
+
+sleep 60;
+bkp_machine;
+
+sleep 3600;