diff --git a/lib/backup_restore/backuper.rb b/lib/backup_restore/backuper.rb index ba890a10b..907ab553b 100644 --- a/lib/backup_restore/backuper.rb +++ b/lib/backup_restore/backuper.rb @@ -230,10 +230,14 @@ module BackupRestore log "Archiving uploads..." FileUtils.cd(File.join(Rails.root, "public")) do - execute_command( - "tar --append --dereference --file #{tar_filename} #{upload_directory}", - "Failed to archive uploads." - ) + if File.directory?(upload_directory) + execute_command( + "tar --append --dereference --file #{tar_filename} #{upload_directory}", + "Failed to archive uploads." + ) + else + log "No uploads found, skipping archiving uploads..." + end end remove_tmp_directory