Hello Ziaur,

Monday, June 09, 2003, 12:27:19 AM, you wrote:


| >>
| >> How can I make a text files ? and I found the user is in /var/mail
| >> How can I copy, paste to that users tell me the command please ???

ZR> You can generate the users list automatically with the help of cron job and an
ZR> amazing utility called awk. Here is an example that you can put in your
ZR> corntab.

ZR> #-- Generate a file with all users from /etc/passwd

ZR> 0 6 * * * /bin/awk -F: '$3 > 100 { print $1"@yourdomain.com" }' /etc/passwd >
ZR> /path-to-dir/allusers

ZR> #--

ZR> To put the above entry in the crontab of root, type:

>> crontab -e

ZR> and then press "i" (without the inverted commas), then copy and paste the above
ZR> line.

ZR> This will generate a file at "/path-todir/allusers" everyday at 6 am. You can
ZR> also manually generate the list by invoking:

>> /bin/awk -F: '$3 > 100 { print $1"@yourdomain.com" }' /etc/passwd >
ZR> /path-to-dir/allusers

ZR> Be sure to replace yourdomain.com with your domain and path-to-dir with the path
ZR> where you want the allusers file to be saved.

ZR> BTW, this will skip the systems users whose uid is less than 100.

ZR> If you are not using /etc/passwd then you are on your own.

ZR> Regards,

ZR> +---------------------------------------------------+
ZR> | Ziaur Rahman           |       PGP Key: 0x8B686E8E|
ZR> | http://zia.info        |        http://pgp.mit.edu|
ZR> |                        |                          |
ZR> +---------------------------------------------------+
ZR> .-.-.-.-.-.-.-.-.- Quote-o-moment .-.-.-.-.-.-.-.-.-.

ZR> Quantum dynamics are affecting the transistors

ZR> .-.-.-.-.-.-.-.-.- Quote-o-moment .-.-.-.-.-.-.-.-.-.
ZR> Composing started at: Mon Jun  9 15:17:03 SGT 2003
ZR>      _)        _)        _|
ZR>  _  / |  _` |   | __ \  |    _ \
ZR>    /  | (   |   | |   | __| (   |
ZR>  ___|_|\__,_|_)_|_|  _|_|  \___/

ZR>  --.. .. .- .-.-.- .. -. ..-. ---
ZR> (           morse code           )






Hi Rahman,

Thanks for the instruction, I had done as per your instruction.Let me
see wherether it's works or not. I had pasted axactly this :

> /bin/awk -F: '$3 > 100 { print $1"@yourdomain.com" }' /etc/passwd >
/path-to-dir/allusers

and same at bolow file :
>crontab -e


Instead of (yourdomain.com) I had kept my own domain name and
Instead of /path-to-dir/allusers I had kept my own path and files
name.

Let me see whether it's generate automatically or not after 6 pm.

If there is more things available then tell me

Thanks for you kind cooperation and good understanding


Best regards,
 santosh                            mailto:[EMAIL PROTECTED]



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to