Skip to content

synchronize two folder with images from source to destination

License

Notifications You must be signed in to change notification settings

dexta/sync2Folder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sync2Folder

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

config.json

{
	"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
}

fileTypes

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"}

logEnable

Write log to a file

verbose

Print everything

delete

Delete a file in the destinationDir if is not in sourceDir

dryRun

Do not touch any files

About

synchronize two folder with images from source to destination

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages