Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#275 closed defect (fixed)

cronload should error when run without arguments

Reported by: adehnert Owned by:
Priority: normal Milestone:
Component: cron Keywords: starter, shell
Cc:

Description

At the moment, if you run cronload with no arguments, it'll give you an error message from cat, and wipe your crontab:

[asa@cats-whiskers]:~/Scripts/django/db2.0/asadb$ cronload
/bin/cat: : No such file or directory
New crontab for asa:

[asa@cats-whiskers]:~/Scripts/django/db2.0/asadb$ 

Instead, it should give you a nice error message and not touch your crontab, or something.

Attachments (2)

patch-275.diff (366 bytes) - added by btidor 12 years ago.
cronload-fix.diff (449 bytes) - added by btidor 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 13 years ago by adehnert

  • Keywords starter shell added

comment:2 Changed 12 years ago by btidor

Works for me...

btidor@mary-kay-commandos:~/cron_scripts$ cronload
Usage "/mit/scripts/arch/i386_rhel3/bin/cronload [-l lockername] [-h] crontab"

comment:3 Changed 12 years ago by andersk

The cronload you ran from the locker is actually a wrapper script around the cronload you get while logged into scripts. This bug is about the latter, and it looks like it still exists.

Changed 12 years ago by btidor

comment:4 Changed 12 years ago by btidor

Also occurs if the named cronfile does not exist. Fixed; see patch.

comment:5 Changed 12 years ago by andersk

The message should be printed to stderr, and the exit status in these cases should be nonzero.

Changed 12 years ago by btidor

comment:6 Changed 12 years ago by ezyang

  • Resolution set to fixed
  • Status changed from new to closed

Committed in r2313, thanks for the patch! (For future reference, it's good to have the svn diff be from the root directory of the repo, so that the filename is identified; there are three files named cronload in our repo!)

Last edited 12 years ago by ezyang (previous) (diff)
Note: See TracTickets for help on using tickets.