Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 38395

Re: Write and external script to delete manual backups possible?

$
0
0
von Davo Smith.  

Well, you'd have to look in the database for your system to check, but the SQL query is going to look something like:

$sql = "SELECT * FROM {files} WHERE component = 'user' AND filearea = 'backup' AND timemodified < :time";

$params = ['time' => time() - (6 * 30 * DAYSECS)];

$files = $DB->get_records_sql($sql, $params);

But, again, you'd have to look in your database to double-check exactly which 'filearea' and 'component' values you are looking for (the local DB only has a 'no user' backup, which, from memory, I think are stored slightly differently).


Viewing all articles
Browse latest Browse all 38395

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>