NASから作業ファイル一式をダウンロードするスクリプトをデプロイする #4

Merged
kazu634 merged 3 commits from deploy-rsync-shell into main 2024-02-12 10:04:55 +00:00
1 changed files with 20 additions and 0 deletions
Showing only changes of commit 2ad8d0938d - Show all commits

View File

@ -0,0 +1,20 @@
#!/bin/bash
CONF=/etc/lsyncd/lsyncd.conf.lua
if [ ! -d mnt/ ]; then
mkdir -p mnt/
rsync -arv kazu634@192.168.10.200:/volume1/homes/kazu634/Drive/Shared/project/ mnt/
fi
if [ ! -e ${CONF} ]; then
sudo cp ./lsyncd.conf.lua ${CONF}
sudo chown root:root ${CONF}
sudo chmod 644 ${CONF}
sudo systemctl enable lsyncd.service
sudo systemctl restart lsyncd.service
fi
exit $?