Skip to main content

Trash

JuiceFS provides Trash to keep files temporarily before deleting from the file system and object storage. Users may restore or delete files from Trash in JuiceFS console.

Move files to Trash

If the file system is created in optimized mode, the files \"deleted\" by users (e.g. using rm command in the shell) will be moved to Trash automatically. These files will no longer be a part of the original directory, but the content is still kept in object storage. If the path of deleted files already exists in Trash, multiple versions will be kept.

Note that Trash does not apply to the following conditions:

  • Trash does not apply to directories, which means directories will be deleted immediately instead of moved to Trash
  • Trash does not apply to file system in compatible mode, under which the files will be deleted immediately instead of moving to Trash
  • Trash does not apply to the command juicefs snapshot -d <path> [options] which will delete the snapshot immediately instead of moving it to Trash. However, snapshot deleted using rm <path> will be moved to Trash instead.
  • Trash does not apply to files created by juicefs import juicefs URI DST [options]. The metadata of the imported files will be deleted immediately, while the content in object storage is not affected.

Delete from Trash

Users can manually delete files from Trash in JuiceFS Console

  1. Click the link of the file system to be managed
  2. Switch to the Trash tab
  3. Select one or more files to be deleted
  4. Click \"Delete\" button
  5. Click \"OK\" to confirm the deletion

Once the files are deleted from Trash, both the metadata in JuiceFS and the content in object storage will be purged. There is no way to undo this operation. Files deleted from Trash can no longer be recovered.

Restore from Trash

Users can restore files from Trash in JuiceFS Console

  1. Click the link of the file system to be managed
  2. Switch to the Trash tab
  3. Select one or more files to be restored
  4. Click \"Restore\" button
  5. Click \"OK\" to confirm restoration.

The parent directories of the files will be created automatically and owned by root (similar to sudo mkdir -p). Please note that it might be different from the original ownership and permissions and needs manual adjustment.

If the path of file to be restored already exists, the restore operation will append a sequence number to the file name to avoid name collision, such as the file /a/b/c.txt in trash will be restored to /a/b/c.txt-1.

If multiple files are selected to restore, they will be restored in the listed order. Files whose path conflict with the ones restored before them will be skipped.

Total number of successfully restored files will be displayed in the page when the operation is done.

Set Trash Expiration Time or Disable

Trash is automatically enabled when users create a file system. The default expiration time is 1 day for the free plan, 7 days for the professional plan. Users may modify this setting in JuiceFS Console. The new expiration time applies for operations after that change. Previous files in Trash are not affected.

In case you want to disable Trash, please set Trash Expiration Time to 0 day.

Billing

When files are moved to Trash, the content in object storage is not affected and are still counted as JuiceFS Usage until the files are deleted from Trash either manually or automatically after the expiration time.