Setting Up a Cron Job or Scheduled Task

If you are running a multi-tenant system with FileCloud, make sure all site URLs for each site are accessible from the local site. These are used by the task scheduler/Cron to run automated tasks for each site


FileCloud needs a Cron job to perform certain ongoing maintenance tasks.
These tasks include:

  • Sending email notifications such as file change notifications, share notifications etc.,
  • Sending admin summary emails
  • Performing recycle bin cleanup
  • Deleting expired shares
  • Archiving old audit records
  • Performing periodic workflow tasks (if configured)
  • Sending SPLA reports (only if there is SPLA licensing)
  • Performing backup jobs (only if there is a backup server)
  • Sending password expiry emails (7 days and 1 day before the expiry date)
  • Sending storage quota notifications (when a specified threshold is met)

Setup Cron Job in Windows

Open the FileCloud Control Panel and click Install for the Cron Task.

Then click Start to start the Cron Task.

Additional Settings for the Cron Task are available by editing the xampp\cron.ini file

frequency=300 ---> Frequency of Cron in seconds (Default is every 5 mins)
timeout=600 ---> Time to wait for Cron to complete in seconds (Default is 10 mins)

Setup Cron Job in Linux


To run from a Cron job:

  • mongodb extension must be enabled in PHP CLI mode. 
  • Ioncube extension must be enabled for PHP CLI mode 

To enable ioncube extension, do the following:

For PHP version less than 7
sudo cp /etc/php5/apache2/conf.d/01ioncube.ini /etc/php5/cli/conf.d/
For PHP version 7+
sudo cp -rf /etc/php/7.0/apache2/conf.d/01-ioncube.ini  /etc/php/7.0/cli/conf.d/

To enable mongodb, add the following line to the end of PHP ini file.

For PHP version 5.x, the php.ini file should be under /etc/php5/cli/

For PHP version 7.x, the php.ini file should be under /etc/php/7.0/cli/

How to set up Cron Job in Linux:

  1. Open the crontab  (assuming apache is running under www-data account).

    crontab -u www-data -e

    In case of centOS, use the following:

    crontab -u apache -e

    At the end of the crontab file add the following line to schedule notifications every 5 minutes.

    For Ubuntu 14.04 or Debian,

    */5 * * * * php /var/www/core/framework/cron.php

    For Ubuntu 16.04 or centOS, 

    */5 * * * * php /var/www/html/core/framework/cron.php

    The above commands assume your FileCloud installation is under /var/www/ folder.

  2. Save and exit.

Set up a Scheduled Task in Windows (alternative to Cron Service)

  1. Use Notepad or a similar program to create a new file named fccron.vbs in a location like c:\xampp\htdocs\resources\backup folder.  
    Enter the following contents from the code block below and save the file. Additionally, in the code block below ensure that paths to php.exe and cron.php files are correct.

    CreateObject("Wscript.Shell").Run "C:\xampp\php\php.exe -f ""c:\xampp\htdocs\core\framework\cron.php"" ", 0, False
  2. Open Task Scheduler:

  3. Click Create Task in the right menu under Actions

  4. On the General Tab

    1. Set the Name to FileCloud Notifications.

    2. Under Security options, select Run whether user is logged on or not.

  5. On the Triggers Tab:

    1. Click New Trigger.
      The New Trigger dialog box opens.

    2. Select On a Schedule from the Begin the task drop-down list.

    3. In Settings, select Daily, select a Start time and then select Recur every: 1 days.

    4. Under Advanced settings, in Repeat task every 5 minutes adjust the value if you want a different frequency of notifications.

    5. Check Enabled.

    6. Click OK.
  6. On the Actions Tab:
    1. Click New Action.
      The New Action dialog box opens:
    2. In Action, choose Start a program.
    3. In the Program/script text box, enter the path to the fccron.vbs file, (for example, c:\xampp\htdocs\resources\backup\fccron.vbs).

    4. You may need to set Start In to c:\xampp\htdocs\resources\backup to resolve a problem.
    5. Click OK.
    6. All other settings can be default, unless there is a specific reason you need to change them.

Verify the Cron Job is Running

  1. Go to admin portal.
  2. In the navigation pane, click Checks.
    Under Extended FileCloud Installation Checks, check the Cron status in the lines highlighted below.