0

I cannot use crontab -e in my git that I installed it in my pc windows 7. It produced the error

bash: crontab: command not found

Did someone use to do it, please tell me?

SRENG Khorn
  • 1,111
  • 1
  • 11
  • 22

1 Answers1

2

I confirm that even the latest git for windows (2.6.3) with its 4.3.42(3)-bash does not include any cron command.

You would need to use another "cron from Windows", like the official Microsoft command Schtasks.exe.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • thank you very much for your answer. I am trying to follow your advices – SRENG Khorn Nov 18 '15 at 09:23
  • Do you know how to install and config it in windows 7? – SRENG Khorn Nov 19 '15 at 01:50
  • @SRENGKhorn Are you talking about `Schtasks.exe`? Because it is available for Windows 7: http://www.robvanderwoude.com/schtasks.php, http://blog.mindfall.net/?p=327. – VonC Nov 19 '15 at 05:12
  • @SRENGKhorn As for the latest gtit for Windows, there is no setyp: just unzip https://github.com/git-for-windows/git/releases/download/v2.6.3.windows.1/PortableGit-2.6.3-64-bit.7z.exe anywhere you want, and add `C:\path\to\PortableGit-2.6.3-64-bit\usr\bin` to your `%PATH%`: you are good to go. – VonC Nov 19 '15 at 05:13
  • So after install and add to `%PATH%` I can use `crontab -e` command in my git-bash? – SRENG Khorn Nov 19 '15 at 05:30
  • @SRENGKhorn my answer is: there is no crontab on Windows: use Schtasks.exe. That what "You would need to use another cron from Windows" means: schtasks as an alternative. – VonC Nov 19 '15 at 05:31
  • how to install schtasks in my pc and run it? – SRENG Khorn Nov 19 '15 at 05:35
  • @SRENGKhorn it is already there. It is installed with Windows 7. `C:\WINDOWS\system32\schtasks.exe` – VonC Nov 19 '15 at 05:36
  • So How can I set schedule for my command in my Laravel project? any tutorial – SRENG Khorn Nov 19 '15 at 06:52
  • @SRENGKhorn Sure: https://www.appnovation.com/blog/how-set-scheduled-tasks-windows-server-2008. Or the end of the question of http://stackoverflow.com/q/9894804/6309 (which references http://stackoverflow.com/a/9895045/6309) – VonC Nov 19 '15 at 07:13
  • I know how to set schedule on windows 7 but my problem is how I implement in `.bat` file to execute code in command folder in Laravel. Could u tell me in more details? – SRENG Khorn Nov 19 '15 at 08:05
  • @SRENGKhorn that I don't know as I don't know Laravel well enough and don't know the commands you need to do. That seems basic scripting: `cd /laravel/path`, then your commands. – VonC Nov 19 '15 at 08:07
  • @SRENGKhorn Remeber, I am answer your *original* question about scheduler on Windows, nothing more here. – VonC Nov 19 '15 at 08:07