mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 09:51:13 +01:00
Add tootctl accounts backup (#8811)
This commit is contained in:
parent
f0fff3eb10
commit
38f5f9cf5b
1 changed files with 22 additions and 1 deletions
|
@ -170,11 +170,32 @@ module Mastodon
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
say("Deleting user with #{account.statuses_count}, this might take a while...")
|
say("Deleting user with #{account.statuses_count} statuses, this might take a while...")
|
||||||
SuspendAccountService.new.call(account, remove_user: true)
|
SuspendAccountService.new.call(account, remove_user: true)
|
||||||
say('OK', :green)
|
say('OK', :green)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc 'backup USERNAME', 'Request a backup for a user'
|
||||||
|
long_desc <<-LONG_DESC
|
||||||
|
Request a new backup for an account with a given USERNAME.
|
||||||
|
|
||||||
|
The backup will be created in Sidekiq asynchronously, and
|
||||||
|
the user will receive an e-mail with a link to it once
|
||||||
|
it's done.
|
||||||
|
LONG_DESC
|
||||||
|
def backup(username)
|
||||||
|
account = Account.find_local(username)
|
||||||
|
|
||||||
|
if account.nil?
|
||||||
|
say('No user with such username', :red)
|
||||||
|
exit(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
backup = account.user.backups.create!
|
||||||
|
BackupWorker.perform_async(backup.id)
|
||||||
|
say('OK', :green)
|
||||||
|
end
|
||||||
|
|
||||||
option :dry_run, type: :boolean
|
option :dry_run, type: :boolean
|
||||||
desc 'cull', 'Remove remote accounts that no longer exist'
|
desc 'cull', 'Remove remote accounts that no longer exist'
|
||||||
long_desc <<-LONG_DESC
|
long_desc <<-LONG_DESC
|
||||||
|
|
Loading…
Reference in a new issue