以下是Copidar在Debian中的使用教程,涵蓋安裝、基本使用、配置及自動化等內容:
sudo apt update
sudo apt install copidar
驗證安裝:
copidar --version
sudo apt install build-essential git cmake
git clone https://github.com/Copidar/Copidar.git
cd Copidar
mkdir build && cd build
cmake .. && make
sudo make install
copidar /path/to/directory
-r
選項copidar -r /path/to/source/ /path/to/destination/
-v
選項copidar -r -v /path/to/source/ /path/to/destination/
通過 cron
設置定期同步(如每5分鐘):
crontab -e
添加以下內容:
*/5 * * * * copidar -r -v /source/ /destination/ > /var/log/copidar.log 2>&1
創建配置文件 ~/.config/copidar/config.yaml
,示例內容:
watch_directories:
- /path/to/watch
- /another/path
event_handlers:
- command: /path/to/script.sh
events:
- create
- modify
- delete
通過配置文件啟動:
copidar -c ~/.config/copidar/config.yaml
--exclude
選項copidar -r --exclude '*.tmp' --exclude 'cache/' /source/ /destination/
nohup
nohup copidar -p 8080 -l 127.0.0.1 > copidar.log 2>&1 &
/var/log/copidar.log
)確保正常運行。更多詳細信息可通過 man copidar
查看官方手冊。
參考來源: