synchronize two folder with images from source to destination Configuration with a file config.json searched at Working, Executeable or given Path.
folderSync -conf=/path/to/the/file/
or local development with config in same folder
go run folderSync.go
{
"sourceDir": "/home/user/sync2Folder/testSourceDir",
"destinationDir": "/home/user/sync2Folder/testDestinationDir",
"fileTypes": ["jpg","png"],
"logEnable": true,
"logPath": "/home/user/sync2Folder/testLogFile.log",
"verbose": true,
"delete": true,
"dryRun": false
}
a list image types not file extension we test the minetype here.
var magicTable = map[string]string{
"image/jpeg": "jpg",
"image/png": "png",
"image/bmp": "bmp",
"image/webp": "webp",
"image/svg+xml": "svg",
"image/gif": "gif"}
Write log to a file
Print everything
Delete a file in the destinationDir if is not in sourceDir
Do not touch any files