Centos 7 で Incron を使用してディレクトリの変更を監視し、それらの変更をローカルの git リポジトリに戻そうとしています。
テストとして、以下を作成しました。
/root/srv <-- The live source directory
/root/git <-- The backup location directory
/root/bin/git-autocommit <-- The script that does the backup and move
私の git-autocommit スクリプトは次のようになります: #!/bin/bash
REP_DIR="/root/git" # repository directory
NOTIFY_DIR="/root/srv" # directory to version
cd $REP_DIR
GIT_WORK_TREE=$NOTIFY_DIR /usr/bin/git add .
GIT_WORK_TREE=$NOTIFY_DIR /usr/bin/git commit -a -m "auto"
そして、私はそれを実行可能にしました。
私は今実行しようとしています:
incrontab -e /root/srv IN_MODIFY,IN_CREATE,IN_MOVED_FROM,IN_MOVED_TO /root/bin/git-autocommit
しかし、私はこのエラーを受け取り続けます:
invalid arguments - operation and source file cannot be combined
何が起こっているのか正確にはわかりません。