0

I'm attempting to batch create some users from a file using the newusers util on ubuntu 18.

When running in cron as the root user, nothing happens. When I run the command manually, it works as expected and creates the users in the file. Heres my crontab, running every minute to test:

*/1 * * * * newusers /tmp/ftp_users.txt

Running it manually like this is fine newusers /tmp/ftp_users.txt.

I have no idea what I'm missing to get this command to run in cron.

kurupt89
  • 117
  • 4

2 Answers2

1

You have to use the full path in cronjobs. So find out the full path to news users (/bin/newusers/) or whatever it is, and place that in your cronjob. You can find the full path by typing

which newusers
Shōgun8
  • 194
  • 1
  • 10
0

Check the mail cron sends to root containing the console output of your command. This will tell you what went wrong.

Tilman Schmidt
  • 3,778
  • 10
  • 23