sync file and directory automatic. Ideas come from t.k..