---
title: Set up the cron job (so TSync runs things on time)
description: A friendly guide to the one background task that lets TSync send reminders, generate recurring invoices, import email leads and run automations on schedule.
product: TSync Intelligence 11.3.6
language: en
canonical: https://docs.tsync.pro/setup-cron-job/
source: https://docs.tsync.pro/llms.txt
---

# Set up the cron job

**What this is:** a small "heartbeat" you set up once so TSync can do timed jobs on its own — even when nobody is logged in. Think of it as winding up a clock: once it's ticking, TSync quietly takes care of routine work in the background every minute.

**Why you care:** without this heartbeat, several handy features simply never run. If reminders aren't going out or recurring invoices aren't appearing, this is almost always the reason.

Here's what stops working when the heartbeat is missing:

- Recurring invoices are not created automatically
- Reminders (overdue invoice, due task, expiring contract) are not sent
- Email-to-lead import doesn't pick up new emails
- Automatic backups don't run
- Subscription email notifications don't go out

So setting this up is **a required step** for a fully working system. The good news: you do it once and then forget about it.

## The one command TSync needs to run

This is the instruction your server will run on a timer. It tells the server "run TSync's background script":

```
php -q /full/path/to/tsyncerp/pipe.php cron
```

You'll need the real location of two things to fill in the blanks:

- **Where TSync is installed** — replace `/full/path/to/tsyncerp/` with your actual folder.
- **Where PHP lives** — most servers know `php`, but to be safe use the full path. This little command prints it for you:

```bash
which php       # usually prints something like /usr/bin/php
which php8.1    # some servers name it with the version
```

**How often?** Once **every minute** is ideal — it keeps reminders and invoices feeling instant.

Pick the section below that matches your hosting. You only need one.

## On Linux (cPanel, Plesk, or your own server)

### The simple way (cPanel control panel)

If your host gives you cPanel, this is the easiest route — no commands to type:

1. In cPanel, open **Cron Jobs** (under the Advanced section).
2. Under **Common Settings**, choose **Once per minute (* * * * *)**.
3. In the **Command** box, paste (with your real path):
   ```
   /usr/bin/php -q /home/USERNAME/public_html/pipe.php cron
   ```
4. Click **Add New Cron Job**. Done.

### The Plesk way

1. In Plesk, open your site and go to **Scheduled Tasks**.
2. Click **Add Task** → **Run a command**.
3. In **Command**, enter (with your real path):
   `php /var/www/vhosts/your-domain/httpdocs/pipe.php cron`
4. Set **Run** to a Cron style of `* * * * *` (that's the code for "every minute").
5. Click **OK**.

### The command-line way (using `crontab`)

If you're comfortable connecting to your server over SSH, this works on any Linux box. Open your personal list of scheduled jobs:

```bash
crontab -e
```

Add this single line — it means "every minute, run TSync's background script quietly":

```cron
* * * * * /usr/bin/php -q /var/www/tsyncerp/pipe.php cron > /dev/null 2>&1
```

(The `> /dev/null 2>&1` part just keeps it from emailing you output every minute.)

Save and exit. If your editor is `vim`, type `:wq`; if it's `nano`, press `Ctrl+O`, `Enter`, then `Ctrl+X`.

To double-check the line was saved:

```bash
crontab -l    # lists your scheduled jobs
```

## On Windows Server (Task Scheduler)

Windows has a built-in tool called **Task Scheduler** for timed jobs:

1. Open **Task Scheduler**.
2. Choose **Create Basic Task** and name it something like "TSync cron".
3. For **Trigger**, pick `Daily`, then set it to repeat every `1 minute`, indefinitely.
4. For **Action**, choose **Start a program** and fill in:
   - **Program**: `C:\php\php.exe` (wherever PHP is installed)
   - **Arguments**: `-q "C:\inetpub\wwwroot\tsyncerp\pipe.php" cron`
   - **Start in**: `C:\inetpub\wwwroot\tsyncerp\`
5. Click Finish.

## No command-line access? Use a web-based timer

If your host doesn't give you SSH but does offer "HTTP cron" (a timer that visits a web address), you can point it at TSync's cron web address:

```cron
* * * * * wget -q -O /dev/null "https://your-domain.com/cron"
```

A small heads-up: this option is **a bit less private**, because anyone who knows that web address could trigger it from outside. If you have the choice, the command-line versions above are the safer pick.

## Check that it's actually working

Three easy ways to confirm the heartbeat is ticking:

### 1. Run it once by hand

This runs the background script a single time, right now, so you can see if it's happy:

```bash
php /var/www/tsyncerp/pipe.php cron
```

No errors means you're good. If you do see a message, here's what it's telling you in plain terms:

- `Could not open input file` → the folder path in your command is wrong — double-check it.
- `No such file` for includes → a folder permissions issue is blocking access.
- `Database error` → the script can't reach the database from the command line (uncommon).

### 2. Look in TSync itself

Go to **Setup → Settings → System/Server Info**. It shows the time the cron last ran. If it's **less than 5 minutes ago**, your heartbeat is healthy.

### 3. Peek at the server's cron log (optional)

If you want proof the server is firing the job:

```bash
# On Linux:
grep CRON /var/log/syslog | tail -20
```

## If something's not right

### Nothing runs at all

- Run `crontab -l` — is the line actually there?
- Use the **full path** to PHP (`/usr/bin/php`), not just `php`. This trips a lot of people up.
- Make sure the account running the job is allowed to run PHP.

### It runs, but nothing happens

- Confirm the database is reachable from the command line.
- Check the "last cron run" time under **Setup → Settings** to see if it's updating.

### A "Memory exhausted" message

The job ran out of working memory. Give it more headroom in your `php.ini` file:

```ini
memory_limit = 512M
```

(Note: the command line sometimes uses a different `php.ini` than your website does — make sure both have a generous limit.)

### Emails still don't send, even though cron runs

That points to email setup, not cron:

- Check **Setup → Settings → Email** that your outgoing mail (SMTP) details are filled in.
- Send a test email from that same screen.

## A lighter schedule (only if your host forces it)

Some budget hosts won't let you run a job every minute. You can run it every 5 minutes instead — reminders and invoices will just feel a touch less instant:

```cron
*/5 * * * * /usr/bin/php /var/www/tsyncerp/pipe.php cron > /dev/null 2>&1
```

For most setups, every minute is the better experience.

## See also

- [Installation & first setup](quick-installation-getting-started-tutorial.md)
- [Need a hand? Contact support](support.md)
