handle files as well as directories for backup