Restores files deleted from Box folders by
aea-box-clean-folders:
Takes a Jira case number and looks up the Box Folder ID from Jira.
Lists files deleted by the service account in the past N days from the case folder or any of its subfolders.
Restores each file to its original folder (the case folder under
1Completed, or a subfolder of it). A file whose original folder no longer exists is restored to the top of the case folder.Once every file is restored, moves the folder out of
1Completed(or a subfolder of it, such as1Completed/aearep-9xxx) back to the root folder, so thataea-box-clean-folderscan process it again. If any file fails to restore, the folder stays in1Completed.
Running it again on a recovered case does nothing. A case folder still in
1Completed with no deleted files left is moved back to the root folder.
The upload link disabled by aea-box-clean-folders stays disabled. To let the
authors upload again, re-enable the folder’s file request in the Box web
interface.
aea-box-recover-files --case 8040 --list # list deleted files
aea-box-recover-files --case 8040 --test # dry run
aea-box-recover-files --case 8040 # restore
aea-box-recover-files --case 8040 --days 14 # look back 14 daysEnvironment¶
Variables not set in the environment are read from ~/.envvars.
Box: the Box app credentials (see Box setup); folder settings in Shared settings
Jira:
JIRA_USERNAME,JIRA_API_KEY