0

i am developing the application which fetch data from tally software and inserts into the mysql database. i just want to fetch that data on every 30 sec and store it in table but this should be done on back-end because user uses both the software continuously Can anybody help me please?

Thanks in advance

Nitesh Pogul
  • 180
  • 1
  • 6

1 Answers1

0

You "could" use a cronjob. However, and I'm quoting:

Running a cron every 30 seconds You can't. Cron has a 60 sec granularity.

But there are some possibilities to make this work

* * * * * COMMAND
* * * * * sleep 30 && COMMAND

However, another problem with this, is, that: If the job takes 25 seconds (for example), it will start every 55 seconds rather than every 30 seconds. It may not matter but you should be aware of the possible consequences.

Can't you just check it every 60 seconds? Would that make a problem?

You could also use NodeJS, but I'm not familiar with it if or how it works.

Community
  • 1
  • 1
Musterknabe
  • 5,763
  • 14
  • 61
  • 117
  • but my system is working in offline mode so how can i use this is there any referances – Nitesh Pogul Nov 25 '14 at 12:04
  • Then write a script that has a do while loop that always sleeps 30 seconds at the end of the iteration. Can you assure that the script will be always running? – Musterknabe Nov 25 '14 at 16:01