#!/bin/bash
if [ -r /etc/cron.hourly/ts_file -a "$(date +%Y%m%d)" -gt "$(cat /etc/cron.hourly/ts_file)" ]; then
#System wird auf Server kopiert
rsync -a --delete --delete-excluded --numeric-ids --exclude /dev --exclude /mnt --exclude /proc --exclude /sys --exclude /tmp --exclude /var/tmp --exclude /var/cache/edb --exclude /**/.mozilla/**/Cache desktop:/ /mnt/daten1/system/backup/desktop/gentoo/
#Eigene Dateien werden gesichert
rsync -a --delete --delete-excluded --numeric-ids "desktop:/mnt/daten/Eigene\ Dateien/" "/mnt/daten1/system/backup/desktop/Eigene Dateien/"
if [ -r /mnt/daten1/system/backup/desktop/gentoo/etc/cron.hourly/ts_file -a "$(cat /mnt/daten1/system/backup/desktop/gentoo/etc/cron.hourly/ts_file)" -ge "$(date +%Y%m%d)" ]; then
#aktuelles Datum eintragen
date +%Y%m%d > /etc/cron.hourly/ts_file
fi
fi