Description
DirSync is utility from sitecenter infra tools. This utility helps to keep to two folders in sync. Usecase for this tool is resized images cache: we have original folder with images and another folder with resized files. This utility compares files in resized folder with original folder and move them to trash folder if original file is newer or doesn't exists.
How to use this utility in practice?
1. Clone and compile repository yourself. Link to github: https://github.com/antoner-m/sitecenter-common
2. Install JRE 8+ (If you don't have it already)
3. create bash script DirSync.sh:
java -cp /home/1c/scripts/lib/sitecenter-infra.jar org.sitecenter.infra.util.DirSync $1 $2 $3
4. setup script to synchronize folders script1.sh:
./DirSync.sh "/path/to/original/folder" "/path/to/duplicated/folder/" "/path/to/deleted/files" >> ./script1.log 2>&1
5. setup cron task for that script.