Giter VIP home page Giter VIP logo

Comments (6)

clonemeagain avatar clonemeagain commented on September 26, 2024

Hiya,
I had a think, and I bet the easiest is to write a wrapper script to call just the archiver part.

  1. Set the plugin's admin config to not auto-purge (Auto-purge old closed tickets, this disables the normal cron interface).
  2. 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).
  3. Change the visibility of the purge method to public (edit the class.ArchiverPlugin.php file), line 62:
private function autoPurge() {

to

public function autoPurge() {
  1. 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.
    }
}
  1. 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.

office222 avatar office222 commented on September 26, 2024

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

ftp-capture1
ftp-capture
ftp-capture3

from osticket-plugin-archiver.

clonemeagain avatar clonemeagain commented on September 26, 2024

from osticket-plugin-archiver.

clonemeagain avatar clonemeagain commented on September 26, 2024

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.

clonemeagain avatar clonemeagain commented on September 26, 2024

Assuming you got it working.

from osticket-plugin-archiver.

office222 avatar office222 commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.