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

install.sh clears user's entire crontab #26

Closed
kvz opened this issue Jun 1, 2011 · 2 comments
Closed

install.sh clears user's entire crontab #26

kvz opened this issue Jun 1, 2011 · 2 comments

Comments

@kvz
Copy link
Contributor

kvz commented Jun 1, 2011

No description provided.

@philcryer
Copy link
Owner

this is fixed, as per this commit:

(crontab -l; echo "$newcronjob") | crontab -u $username - #list crontab, read entry from crontab, add line from stdin to crontab

thanks!

@Thynix
Copy link

Thynix commented Jun 19, 2011

This still happens if install.sh is run as root. This is because it sets the target user's crontab to the current user's crontab with the line appended. The target user's contab may disappear or otherwise be modified in unexpected ways if the current user is root.

(crontab -l; echo "$newcronjob") | crontab -u $username - #list crontab, read entry from crontab, add line from stdin to crontab

should therefore be

(crontab -u $username -l; echo "$newcronjob") | crontab -u $username - #list crontab, read entry from crontab, add line from stdin to crontab

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

No branches or pull requests

3 participants