From: Diogo Cordeiro Date: Thu, 9 Aug 2018 15:54:10 +0000 (+0100) Subject: Script for removing remote files until a given date X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4211206e3be06baa6c63af8c9fc819db3020d559;p=quix0rs-gnu-social.git Script for removing remote files until a given date --- diff --git a/plugins/StoreRemoteMedia/scripts/removeRemoteMedia.php b/plugins/StoreRemoteMedia/scripts/removeRemoteMedia.php new file mode 100755 index 0000000000..8b94ac04c4 --- /dev/null +++ b/plugins/StoreRemoteMedia/scripts/removeRemoteMedia.php @@ -0,0 +1,82 @@ +#!/usr/bin/env php +. + * + * @category Plugin + * @package GNUsocial + * @copyright 2018 Free Software Foundation http://fsf.org + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link https://www.gnu.org/software/social/ + */ + +// Script author: Diogo Cordeiro + +define('INSTALLDIR', realpath(__DIR__ . '/../../..')); + +$longoptions = ['limit=']; + +$helptext = <<query($query); +while ($fn->fetch()) { + $file = File::getByID($fn->file_id); + $file_info_id = $file->getID(); + // Delete current file + $file->delete(); + if (!$quiet) { + echo "Deleted file with id: {$file_info_id}\n"; + } +}