Results 1 to 5 of 5

Thread: Deleting cron mails

  1. #1
    Join Date
    Jun 2008
    Location
    /dev/swat
    Posts
    1,181

    Default Deleting cron mails

    Hi,
    Is there a way to delete all the mails created by cron in /var/spool/.
    Linux[openSUSE, KDE], PHP, MySQL, Wordpress, Tech News, etc :
    http://anl4u.com

  2. #2
    ab@novell.com NNTP User

    Default Re: Deleting cron mails

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    There may be, but I always do it by just logging in as the user
    receiving the mail (usually root) at the command line and using the
    'mail' command. You can press 'd' (delete) and then select all of the
    messages you don't want and they will be deleted. Messages are selected
    by number and are space delimited so:

    d 1 2 3 4 5 6 8 9 10

    would delete the first ten messages.

    Good luck.





    mmarif4u wrote:
    > Hi,
    > Is there a way to delete all the mails created by cron in /var/spool/.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFI3Hci3s42bA80+9kRAisTAJ4sLvQeWGGumMqLXKzYZT7+7slNTQCeMYTH
    GU0uRvf6HCwbmtjviRHZNIc=
    =C0Ag
    -----END PGP SIGNATURE-----

  3. #3
    ab@novell.com NNTP User

    Default Re: Deleting cron mails

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Shoot.... I forgot to mention that you get those automatically if any
    data are sent to STDERR or (I think) STDOUT when your cron job runs so
    if you want to prevent these mail messages entirely add the following to
    the end of your command which has output:

    >/dev/null 2>&1


    Good luck.





    ab@novell.com wrote:
    > There may be, but I always do it by just logging in as the user
    > receiving the mail (usually root) at the command line and using the
    > 'mail' command. You can press 'd' (delete) and then select all of the
    > messages you don't want and they will be deleted. Messages are selected
    > by number and are space delimited so:
    >
    > d 1 2 3 4 5 6 8 9 10
    >
    > would delete the first ten messages.
    >
    > Good luck.
    >
    >
    >
    >
    >
    > mmarif4u wrote:
    >> Hi,
    >> Is there a way to delete all the mails created by cron in /var/spool/.

    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFI3Hdc3s42bA80+9kRAkSTAJ0VWBDgTszwezBFkKNtsNY6jjMH+wCfWMdm
    qZTrdrhfCnJGodPy7UbQO00=
    =1Gkx
    -----END PGP SIGNATURE-----

  4. #4
    Join Date
    Jun 2008
    Location
    /dev/swat
    Posts
    1,181

    Default Re: Deleting cron mails

    Thanks for the hints.
    Actually the method 'd' is nice, but if you have 2750 messages, then its pain in the neck, to mention one by one to delete.

    Abt the 2nd method to not receive mail.thanks for that.

    Hope somebody have idea, that how to delete all existing messages in a one shoot.
    Linux[openSUSE, KDE], PHP, MySQL, Wordpress, Tech News, etc :
    http://anl4u.com

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Deleting cron mails

    Code:
    d *
    You can also delete a range:

    Code:
    d 1-10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •