TaskTree tree = sync.executeProfile(profile, false);
if (tree == null) {
profile.setLastError(1, "An error occured while comparing filesystems.");
}
else {
int errorLevel = sync.performActions(tree);
if (errorLevel > 0) {
profile.setLastError(errorLevel, "An error occured while copying files.");
}
else {
profile.setLastUpdate(new Date());