aerni / laravel-sync

A git-like artisan command to easily sync files and folders between environments.
MIT License
64 stars 3 forks source link

Use with Laravel Scheduler #10

Closed twd3 closed 2 weeks ago

twd3 commented 2 weeks ago

Thank you for this, it's exactly what I was looking for. I'm going to be using this with Laravel Scheduler (assuming it works) but I'm confused about how the syntax would go. Do you know if it would be like this? Specifically this: artisan:sync:pull:production:content --no-interaction

$schedule->command('artisan:sync:pull:production:content --no-interaction')->weekdays()->dailyAt('03:00')->timezone('America/Denver');

aerni commented 2 weeks ago

Have you read the docs on task scheduling?

I think this should work:

$schedule->command('sync pull production content --no-interaction')
    ->weekdays()
    ->dailyAt('03:00')
    ->timezone('America/Denver');
twd3 commented 2 weeks ago

Yeah, that's the thing, I have read those docs and I'm still confused. Mainly because I'm already using scheduler for git commits and that looks like this: ->command('statamic:git:commit'). I know the other settings are right I'm just confused about the command syntax, again because this working git command has the colon's. I'll try to test. Closing because this isn't an issue just a question. Thanks again!