Custom rake task for removing packages on Faspex

Rake tasks are scripts that allow you to retrieve, delete or update information on your Faspex server using the command line. This article describes a custom rake task available for removing packages uploaded to Faspex.

Please note that you must install this rake task as it is not yet included by default on Faspex. For more information on custom rake tasks and how to install them, see this article (Custom rake tasks on Faspex).

Usage

This rake task removes package information corresponding to the Server page under the Packages tab of the web interface. The rake task removes the package from the database but does not delete the file saved in your package directory. This may be useful if you do not want certain packages to appear in reports or no longer have a use for the data saved for these packages.

The syntax for this rake task is as follows:

asctl faspex:rake custom:remove_pkgs -- [options]

The available options are the following:

short form long form description                                                                                      
-ddays --day=days packages older than this number of days
-ttitle --title=title packages that match this title
-ss1,s2,s3 --status=s1,s2,s3

packages that match the specified status(es); can include up to 3 statuses

-i uuid --uuid="xxx...."

packages that match this uuid

-h --help print out help information for this rake task


The possible status values are:

  • STATUS_COMPLETE
  • STATUS_TRANSFERRING
  • STATUS_PAUSED
  • STATUS_ERROR
  • STATUS_WILLRETRY
  • STATUS_STOPPED
  • STATUS_SUBMITTED
  • STATUS_TIMED_OUT


Note that this operation is not reversible. You should backup the Faspex database before running the rake task, which you can do with the following command:

asctl faspex:backup_database 

Examples

To remove all packages from the database older than 90 days, you would use the following command:

asctl faspex:rake custom:remove_pkgs --  -d90

To remove all packages with the status STATUS_COMPLETE, you would run the following:

asctl faspex:rake custom:remove_pkgs -- --status=STATUS_COMPLETE

Below is an example of what the output could look like:

Removed 7 Packages(s)
List of packages  destroyed
5  - project files
6  - new package
7  - updated files
8  - my files
9  - even more files
10  - download this
11  - files

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk