Scheduled Job: Clear Temporary Files

Overview

As of Hotcakes Commerce 3.3.0, a scheduled job has been added to help automate the maintenance of your store.  The scheduled job is added for you upon installation and upgrade, and it's pre-configured to run once a week.  When this job runs, it will iterate through the Hotcakes Commerce temporary folder in each store (website) portals folder and delete any temporary files it finds.  These files include images, Excel spreadsheets, and other files you may have uploaded while managing the store.  These files will not be deleted for you otherwise.  

Requirements

The following pre-requisites will be necessary to accomplish the goals of this article:

  • General understanding of content management
  • General understanding how scheduler systems work 
  • Familiarity with website hosting and management
  • Superuser access on your website

Getting Started

It would be a good idea to familiarize yourself with the Scheduled Jobs feature in the CMS before you change how it works.  Sometimes, what may appear to be a minor update could present an adverse effect to your website visitors - up to and including crashing your website.  

Clear Temporary Files

The Clear Temporary Files scheduled job allows you to specify if the temporary files get deleted from your website, and how often.  If you never delete these files in a larger (or more active) store, it's possible that you may run into disk space restrictions.  

In order to manage this feature, you'll need to be logged in as a superuser.  You'll find the Scheduled Job feature in the persona bar, on the left side of your page.  

hcc-delete-temp-files-scheduled-job-01.png

The Scheduler displays the initial configuration and the ability for you to stop the scheduler, if you wish.  It includes three tabs:

  • Task Queue:  This lists all of the active scheduled jobs and when they're going to run.
  • Scheduler:  This is the primary view you'd use to manage any installed scheduled jobs, and to add a new one.  
  • History:  This view allows you to see scheduled jobs that have already run, so you can inspect their status.  You can do this for a single scheduled job by selecting it in the Scheduler tab as well.

hcc-delete-temp-files-scheduled-job-02.png

When you select the Scheduler tab, you'll be able to find the Clear Temporary Files scheduled job in the list.  From here, you can click the pencil icon to edit it or the timer icon to see the history.

hcc-delete-temp-files-scheduled-job-03.png

This is what the history might look like if you choose to look at it.  It includes when the job started, when it ended, how long it ran, and if it succeeded.

hcc-delete-temp-files-scheduled-job-04.png

When you click on the pencil icon to edit the scheduled job, you'll have several options available to you. 

You should refrain from editing any of the settings unless you have a full understanding of the potential impacts these changes may have on your hosting environment.  

hcc-delete-temp-files-scheduled-job-05.png

The default or suggested values that you'll find are listed below.  

Member Type Description
Friendly Name String Hotcakes Commerce: Clear Temporary Files
Full Class Name and Assembly String Hotcakes.Modules.Core.ClearUploadTempFiles, Hotcakes.Modules
Retain Schedule History Integer It's a good idea to always keep at least 10 instances of the schedule history, depending on how frequently it is running.  
Frequency Time Span By default, this will be 1 week.  In most cases, this is actually more than necessary.  Once a month may be good as well.  However, this default is good for keeping your website files and folders cleansed for any daily/weekly backups that you may have running.  
Retry Lapse Time Span By default, this will be 30 minutes.  Which is enough time for most websites to recover from any behavior that may have prevented this task from running previously.
Run on Event String In order to reduce any risk to the startup and performance of your website, you should keep this setting as "None" in most cases.
Enable Schedule Boolean

It's recommended that this scheduled task remain enabled on all Hotcakes Commerce websites that are actively using the store features.  This is especially true if you have more than one person managing the store.

 

Have more questions? Submit a request

Need More Help?

Do you need more assistance with this article? Please review your support options.