view 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 source

#!/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;