File Lifecycle Management

Marketplace URL: File Lifecycle Management

The File Lifecycle Management extension allows service providers to manage the lifecycle of files within ownCloud. For details please see the File Lifecycle Management documentation.

The lifecycle commands configure the File Lifecycle Management app.

App Configuration
lifecycle
 lifecycle:archive          Archive files which have reached a certain age
 lifecycle:expire           Expire files from Archive which have reached a certain age
 lifecycle:restore          Restore files from Archive to the original location
 lifecycle:restore-all      Restore all archived files in the system back to their
                            original locations
 lifecycle:set-upload-time  Set upload time for files which do not have one

config:app commands configure the Policies for the File Lifecycle Management app.

Policy Configuration
 config:app:get|set
 files_lifecycle archive_period   Number of days since upload (or restore)
                                  after which files will be archived
 files_lifecycle expire_period    Number of days since archiving after which files will
                                  be permanently deleted
 files_lifecycle excluded_groups  Define groups of users that are exempt from the
                                  lifecycle policies
 files_lifecycle policy           Restoration policies for users
 files_lifecycle disable_ui       Enable/Disable the user interface components

App Configuration

Archive Aged Files

Archive files which have reached a certain age.

sudo -u www-data php occ lifecycle:archive [options]

Options

-d,
--dryrun[=DRYRUN]

Don’t apply changes to the system [default: false]

Expire Files From Archive

Expire files from archive which have reached a certain age.

sudo -u www-data php occ lifecycle:expire [options]

Options

-d,
--dryrun[=DRYRUN]

Don’t apply changes to the system [default: false]

Restore Files From Archive

Restore files from archive to the original location. Note that the location for archived files always follows the pattern $userid/archive/files/…​

sudo -u www-data php occ lifecycle:restore <path>

Arguments

path

Enter path to a folder or to a single file

Example

Restore all files in folder project1 for user alice with path /work/projects/project1

sudo -u www-data php occ lifecycle:restore /alice/archive/files/work/projects/project1

Restore All Files From Archive

Restore all archived files for all users in the system back to their original locations. This command has no additional arguments or options.

sudo -u www-data php occ lifecycle:restore-all

Set Default Upload Time

Set upload time for files which do not have one.

Files without upload time are silently skipped by occ lifecycle:archive This can happen with files that were uploaded before the files_lifecycle app was configured or when it was temporarily disabled and therefore do not have an upload time set.
sudo -u www-data php occ lifecycle:set-upload-time [options] [--] <date>

Arguments

date

Date in format y-m-d. Example: 2018-07-23

Options

-d,
--dryrun[=DRYRUN]

Don’t apply changes to the system [default: false]

Policy Configuration

All policy configurations are set and queried with the config:app command set. The examples below set a value. To query a value use config:app:get and the corresponding key without any options or attributes.

Set the Archive Period

The number of days since upload (or restore) after which files will be archived.

The following example command sets the time passed since upload (or restore) for archiving files to 90 days.

sudo -u www-data php occ config:app:set files_lifecycle archive_period --value='90'

Set the Expire Period

The number of days since archiving after which files will be permanently deleted.

The following example command sets the time passed to delete files to 180 days.

sudo -u www-data php occ config:app:set files_lifecycle expire_period --value='180'

Set Groups to be Excluded

Define groups of users that are exempt from the lifecycle policies (comma-separated group ids).

The following example command specifies groups whose members will not be part of the lifecycle management.

sudo -u www-data php occ config:app:set files_lifecycle excluded_groups --value='group1,group2'

Restoration Policy for Users

Set a policy who can restore files. Use the value soft for self-service and hard for admin/groupadmin-service.

The following example command sets the restauration policy for users to soft (default).

sudo -u www-data php occ config:app:set files_lifecycle policy --value='soft'

Disable User Interface

Disable the whole user interface for the File Lifecycle Management app.

The following example command disables the user interface for the File Lifecycle Management app.

sudo -u www-data php occ config:app:set files_lifecycle disable_ui --value='yes'

You can reenable it by deleting the key:

sudo -u www-data php occ config:app:delete files_lifecycle disable_ui