fix(synchronize): clean files after sync (refs #4427)

Add a function to suppress files after synchronisation
Register function in synchronize process