file backup using helper function