среда, 14 декабря 2016 г.

Rsync to Synoilogy NAS

Generate public key on Rpi
 ssh-keygen

Log in to Synology Telnet as root (sudo -i , password)

Copy public key
tail ~/.ssh/id_rsa.pub

Use instruction below
http://www.thegeekstuff.com/2008/06/perform-ssh-and-scp-without-entering-password-on-openssh/

verify if password is asked:
ssh '192.168.1.23'

rsync script:
#!/bin/bash
# Script to save and copy mosq to server
cp /var/log/mosquitto/mosq.log "/var/log/mosquitto/mosq_backup$(date +%Y%m%d_%H%M%S).log"
> /var/log/mosquitto/mosq.log
sudo rsync -av -e ssh /var/log/mosquitto/ 192.168.1.23::Backup/raspberry/
rm /var/log/mosquitto/mosq_backup*


Fstab
tmpfs    /var/log    tmpfs    defaults,noatime,nosuid,mode=0777,size=100m    0 0
tmpfs    /var/log/openhab    tmpfs    defaults,noatime,nosuid,mode=0777,size=150m    0 0
tmpfs    /tmp    tmpfs    defaults,noatime,nosuid,size=20m    0 0
tmpfs    /var/tmp    tmpfs    defaults,noatime,nosuid,size=20m    0 0

 

Комментариев нет:

Отправить комментарий