#!/bin/ash
clear
set -x
echo "starting backup"
ssh oppenheimer "echo 3 > /dev/ttyS1; echo "":"" > /dev/ttyS1; exit;"
/usr/syno/bin/synonetbkp -a "networkBackupVolume1"
wait
/usr/syno/bin/synonetbkp -a "networkBackupVolume2"
wait
echo "done, system will shut down in a few sconds"
ssh oppenheimer "echo 8 > /dev/ttyS1; echo 3 > /dev/ttyS1;"
ssh oppenheimer "poweroff"
echo "shutdown signal was sent"
exit
#!/bin/ash
clear
set -x
echo "starting backup"
ssh oppenheimer "echo 3 > /dev/ttyS1; echo "":"" > /dev/ttyS1; exit;"
/usr/syno/bin/synonetbkp -a "networkBackupVolume1"
/bin/sleep 30
while (ps | grep networkBackupVolume1 | grep -v grep)
do
echo networkBackup still running
/bin/sleep 5
done
/usr/syno/bin/synonetbkp -a "networkBackupVolume2"
/bin/sleep 30
while (ps | grep networkBackupVolume2 | grep -v grep)
do
echo networkBackup still running
/bin/sleep 5
done
echo "done, system will shut down in a few sconds"
ssh oppenheimer "echo 8 > /dev/ttyS1; echo 3 > /dev/ttyS1; poweroff;"
echo "shutdown signal was sent"
exit
while true ; do
[ "x$(ps | grep networkBackupVolume1 | grep -v grep)" != 'x' ] && sleep 30 && continue
break
done
#!/bin/ash
clear
ssh oppenheimer "echo 3 > /dev/ttyS1; echo "":"" > /dev/ttyS1; exit;"
/usr/syno/bin/synonetbkp -a "networkBackupVolume1"
/usr/syno/bin/synonetbkp -a "networkBackupVolume2"
/bin/sleep 10
/volume2/homes/leetbashhaXXor1337/BashScripting/helper.sh
while (/bin/ps | /bin/grep networkBackupVolume | /bin/grep -v grep)
do
/bin/sleep 5
done
ssh oppenheimer "echo 8 > /dev/ttyS1; echo 3 > /dev/ttyS1; poweroff;"
exit
#!/bin/ash
/usr/syno/bin/rsync -avz /volume1/src/dir/ root@oppenheimer:/volume1/trgt/dir/ >> /volume2/log/dir/logA.txt
/usr/syno/bin/rsync -avz /volume2/src/dir/ root@oppenheimer:/volume2/trgt/dir/ >> /volume2/log/dir/logB.txt
ssh oppenheimer "echo 3 > /dev/ttyS1; poweroff;"
exit
echo's wurden entfernt nachdem das script lauffähig war.
#!/bin/ash
clear
echo "RSYNC jobs started on: `date`" >> /path/to/log.log
/usr/syno/bin/rsync --stats -ahz /volume1/music/ rsync://root@oppenheimer/music/ >> /path/to/log.log
/usr/syno/bin/rsync --stats -ahz /volume1/photo/ rsync://root@oppenheimer/photo/ >> /path/to/log.log
/usr/syno/bin/rsync --stats -ahz /volume1/web/ rsync://root@oppenheimer/web/ >> /path/to/log.log
/usr/syno/bin/rsync --stats -ahz /volume1/video/Seasons/ rsync://root@oppenheimer/Seasons/ >> /path/to/log.log
/usr/syno/bin/rsync --stats -ahz /volume2/homes/ rsync://root@oppenheimer/homes/ >> /path/to/log.log
/usr/syno/bin/rsync --stats -ahz /volume2/softwarearchive/ rsync://root@oppenheimer/softwarearchive/ >> /path/to/log.log
echo "RSYNC jobs stopped on: `date`" >> /path/to/log.log
/bin/sleep 30
echo 3 > /dev/ttyS1;
/bin/sleep 5
ssh oppenheimer "poweroff;"
echo "RSYNC cronjob finished. Logfile is attached to this email." | /opt/bin/nail -s "Rsync status Email" -a /path/to/log.log user@host.tld
exit
[music]
path = /volume1/RSYNC1/music
comment = Music rsync dir
uid = root
gid = root
read only = no
list = yes
charset = utf-8
#auth users = root
secrets file = /etc/rsyncd.secrets
hosts allow = einstein_ip_adress
hosts deny = all
Was musste ich noch anpassen?
- in /usr/syno/etc/rc.d/S84rsyncd.sh den Pfad des rsync binaries auf /opt/bin/rsync ändern und
- " $Rsync --daemon" auf erweitern auf "$Rsync --daemon --config=/etc/rsyncd.conf"
- Benutzer/Passwörter unter /etc/rsyncd.secrets anpassen
Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.
Als Dankeschön schalten wir deinen Account werbefrei.