Created
August 27, 2016 07:34
-
-
Save EmilVarona/47ae4cf5d638cfeba70408c0d8d556f3 to your computer and use it in GitHub Desktop.
add line to user crontab by script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z $1 ]]; then | |
echo ERROR: no target user ID given' | |
exit 1 | |
else | |
someUser=$1 | |
fi | |
sudo /bin/bash -c "echo \*/2 \* \* \* \* /my/command >> /var/spool/cron/${someUser}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment