Comments (6)
Hiya,
I had a think, and I bet the easiest is to write a wrapper script to call just the archiver part.
- Set the plugin's admin config to not auto-purge (
Auto-purge old closed tickets
, this disables the normal cron interface). - Ensure you've set a ticket age to purge and a number to purge, if you want ALL that are too old, set a massive number (9999999 etc).
- Change the visibility of the purge method to public (edit the
class.ArchiverPlugin.php
file), line 62:
private function autoPurge() {
to
public function autoPurge() {
- Make a script like this example (can be placed anywhere)
#!/usr/bin/php
<?php
ob_start();
include_once '/path/to/osticket/main.inc.php'; // Load osTicket
ob_clean(); // ignore header's
global $ost; // for IDE
// Locate the Archive plugin from the active list:
foreach ($ost->plugins->allActive() as $plugin) {
// The archiver plugin can be identified by it's class
if ($plugin instanceof ArchiverPlugin) {
// Force to run now by setting last-run time far in the past
$plugin->getConfig()->set('last-run', -time());
// Start purging
$plugin->autoPurge(); // you made the method public right?, otherwise you'll see an error here.
}
}
- Mark it executable and construct a cronjob to call it once a month: https://crontab.guru/every-month
0 0 1 * * web-user /path/to/script.php
Note: If the plugin is not enabled, the script will not work.
from osticket-plugin-archiver.
Thank you for your help.
I seem to be having a problem with cron.
/usr/local/cpanel/bin/jailshell: /home/----/public_html/----/----/include/plugins/archive/archiver-cron.php: Permission denied
0 | 0 | 26 | * | * | /home/----/public_html/----/----/include/plugins/archive/archiver-cron.php
from osticket-plugin-archiver.
from osticket-plugin-archiver.
Oh, I see where you got that from, I suggested using a large number of tickets to purge as you'd be doing it once a month rather that potentially every cron. You've got it set to 1000, which might be enough depending on how many tickets you create every month.
from osticket-plugin-archiver.
Assuming you got it working.
from osticket-plugin-archiver.
Hi, thanks for checking.
No, it is not running, and I can't get to it for almost a week.
Thank you
from osticket-plugin-archiver.
Related Issues (19)
- Advanced Export fail HOT 7
- Polish Readme HOT 1
- Importer
- Logo missing from PDF HOT 3
- Option to just purge old tickets
- In 1.9.12 Internal Server Error HOT 2
- Error after installing plugin HOT 9
- Please use tags for releases to identify compatible osTicket version.
- Plugin not working
- Call to undefined method QuerySet::getAttachments
- is still working? HOT 1
- PHP Parse error for folder path in Advanced mode
- Version 1.14.1 HOT 2
- osTicket 1.15 HOT 1
- All data is not cleaned up
- Change status to Archived without changing the Closure Date value HOT 1
- Is there a way to Manually run this plug-in?
- Compatible with 1.17.2?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osticket-plugin-archiver.