Storage Cleaner
Scan the uploads folder for disconected files with the database (also help you to backup your project and database).
Storage Cleaner
Scan the uploads folder for disconected files with the database (also help you to backup your project and database).
This amazing October CMS plugin will scan the uploads folder, searching disconnected files with the database and vice versa.
Heads up! This feature will delete files from your disk and data in your database.
Adictionally, this script provide a fast way to backup your project. Generating a zip file of your entire project (optimized, of course) and dump your database.
Heads up again! This features require that your php can run the awesome
shell_execand your OS also has the programmysqldumpavailable to be used.
Usage
After install the commands bellow will be available:
# storage clear
php artisan storage:clear
# backup you project and database
php artisan storage:dump
# backup you project only
php artisan storage:dump-project
# backup you database only
php artisan storage:dump-database
Installation via Command Line
php artisan plugin:install Genius.StorageClear
After install the commands bellow will be available:
# storage clear
php artisan storage:clear
# backup you project and database
php artisan storage:dump
# backup you project only
php artisan storage:dump-project
# backup you database only
php artisan storage:dump-database
Storage Clean command
- This command will look in your storage directory: storage/app/uploads for files that are not linked to the \System\Models\File entity (which we love so much);
- Files that have no link will be removed, including the thumbnails generated at runtime (do not worry, they [thumbnails] will be regenerated according to the need);
- Then will be located the records of File entity that does not have disk files, they will also be deleted;
- Finally... remove empty folders!
Storage Dump Project command
- This command will generate a optimized zip of all your project files and plugins;
- After, you can easily upload your zip at any host, extract them and be happy!
Storage Dump Project command
- This command will generate a dump of your database in a .sql file;
- After you can import your sql file wherever you want to and be happy again!
TODO
- Finish brazilian-portuguese translations;
- Create more translations files;
- Create a backend interface as shortcut for commands;
-
Gonzalo Henríquez
The plugin works pre 420. There are two PRs that make it L5.5 friendly but no project seems abandoned.
Clone https://github.com/wiz-comunicaciones/oc-storageclear-plugin for an updated version
-
Xitara
[ReflectionException]
Method Genius\StorageClear\Console\StorageClear::handle() does not existand no fix after 3 years
-
大风哥
you should do the following first: /usr/local/php/etc php.ini find:disable_functions,and remove these:shell_exec,proc_open,proc_get_status, Then,restart apache: /etc/init.d/httpd restart
-
Waka Jeng
Where exactly does it backup your data ?
-
Andy Barker
This is one of the most useful plugins for october. It is great for your dev box where you (occasionally :-) get things wrong or wind back a database. Thanks for contributing
-
Mattias Hamberg
Great idea. Could be included in core
-
Douglas Godinho
Simple and objective, does what it promises!
-
| 1.1.1 |
Removed .idea and .env from project dump Sep 21, 2016 |
|---|---|
| 1.1.0 |
Translations for all commands feedbacks Sep 07, 2016 |
| 1.0.1 |
First version of Storage Cleaner Nov 24, 2015 |