Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed random log #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

removed random log #46

wants to merge 1 commit into from

Conversation

gondo
Copy link
Contributor

@gondo gondo commented Aug 5, 2014

#44

$file = \tempnam(\sys_get_temp_dir(), 'cron');

\file_put_contents($file, $this->getRaw().PHP_EOL);

$process = new Process('crontab '.$file);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This obviously cannot work, here the $file variable would be empty. You can simply delete the file after $process->run();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeap, my fault. my comment was more towards the solution:

$job = '* * * * * command.sh';
$process = new Process('crontab '.$job);

to avoid unnecessary I/O

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work with multiline crons?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure if i understand, can you give me some example?
if by multiple crons you mean multiple commands in one $file, than you can just simply call new Process multiple times, no?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you call $this->getRaw(), you get the fullist of crons that should replace the current cron table.
If you have several crons, they will be separated by PHP_EOL chars.
So my question is, when calling $process = new Process('crontab '.$this->getRaw().PHP_EOL); does it work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see. well if you are replacing the whole crontab, than you would have to drop existing crons (duno how exactly crontab works, but google is our friend)
and adding crons like should work (again google is friend):
join(PHP_EOL, $this->getRaw())
ofc you would have to try
my point is, that doing unnecessary I/Os and creating mess in /tmp dir is messy

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well are you up to fix your PR then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, sorry, not in the near future

@rmjspaz
Copy link

rmjspaz commented Nov 11, 2022

access_control:
    - { path: ^/admin, role: ROLE_ADMIN }

@rmjspaz
Copy link

rmjspaz commented Nov 11, 2022

#46
Duplicate of # #94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants