以下是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/
nohupnohup copidar -p 8080 -l 127.0.0.1 > copidar.log 2>&1 &
/var/log/copidar.log)确保正常运行。更多详细信息可通过 man copidar 查看官方手册。
参考来源: