und kein Erfolg, die erste Zeile ist zum Testen. Ich möchte, dass mein Internet abgeschaltet wird. Die nächsten zwei Zeilen, in denen ich vorbeigehen möchte, sobald ich damit fertig bin.
Wenn ich dies in das Terminal eingebe, geht das Internet aus
ifconfig en0 down
Warum schaltet mein Cronjob das Internet nicht aus?
Wenn Sie Befehle in Ihre Crontab eingeben, müssen Sie den Benutzer nicht angeben, da für jeden Benutzer eine eigene Crontab in / usr / lib / cron / tabs / gespeichert ist.
Ihr Crontab sollte wie folgt aussehen: * * * * * /sbin/ifconfig en0 down > /dev/null 0 19 * * * /sbin/ifconfig en0 down > /dev/null 0 7 * * * /sbin/ifconfig en0 up > /dev/null
0
Community
Do you have a wifi router, and your airport still open? If so, you need to shut that off as well. Either shut it off permanently though System Preferences -> Networking, or use cron commands to do the same. On my machine the Airport is en1, but I've explained how to check in an answer to your original question if you're not sure.
Another thing to check is the path at the top of the crontab file. It must provide access to the ifconfig command.
Run 'whereis ifconfig' on the terminal to find out where the ifconfig command is located, and add that path to the path command at the top of the crontab file if it's not there.