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:
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:
- In cPanel, open Cron Jobs (under the Advanced section).
- Under Common Settings, choose Once per minute (* * * * *).
- In the Command box, paste (with your real path):
/usr/bin/php -q /home/USERNAME/public_html/pipe.php cron - Click Add New Cron Job. Done.
The Plesk way
- In Plesk, open your site and go to Scheduled Tasks.
- Click Add Task → Run a command.
- In Command, enter (with your real path):
php /var/www/vhosts/your-domain/httpdocs/pipe.php cron - Set Run to a Cron style of
* * * * *(that's the code for "every minute"). - 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:
crontab -e
Add this single line — it means "every minute, run TSync's background script quietly":
* * * * * /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:
crontab -l # lists your scheduled jobs
On Windows Server (Task Scheduler)
Windows has a built-in tool called Task Scheduler for timed jobs:
- Open Task Scheduler.
- Choose Create Basic Task and name it something like "TSync cron".
- For Trigger, pick
Daily, then set it to repeat every1 minute, indefinitely. - 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\
- Program:
- 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:
* * * * * 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:
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 filefor 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:
# 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 justphp. 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:
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:
*/5 * * * * /usr/bin/php /var/www/tsyncerp/pipe.php cron > /dev/null 2>&1
For most setups, every minute is the better experience.