...
Kodeblok |
---|
title | openhab-tar-backup.sh |
---|
|
#!/bin/bash
now=`date +"%Y_%d_%m"`
cd /etc/openhab2/
tar -cvzf /home/bnp/openhab-etc-$now.tgz /etc/openhab2/*
cd /usr/share/openhab2/
tar -cvzf /home/bnp/openhab-usr-share-$now.tgz /usr/share/openhab2/* |
Or, alternate as (with nice openHAB shutdown first):
Kodeblok |
---|
title | openhab-tar-backup.sh |
---|
|
#!/bin/bash
now=`date +"%Y_%d_%m"`
/etc/init.d/openhab2 stop
cd /etc/openhab2/
tar -cvzf /home/bnp/openhab-etc-$now.tgz /etc/openhab2/*
cd /usr/share/openhab2/
tar -cvzf /home/bnp/openhab-usr-share-$now.tgz /usr/share/openhab2/*
/etc/init.d/openhab2 start |
...