Help with DD and emailing the results
Good Morning,
I have a question. I would like to use dd to wipe a drive, i can do this no problem with the command: dd if=/dev/zero of=/dev/hda bs=1024 what i want to do is actually email a log with the date, time, computer name, and wether the script completed okay to someone. How could i do this at the command line? Keep in mind i would like to use the a very minimal kernel install to do this. (I think im going to have to add mail to tthe kernel) thanks booyaa |
Assuming you already have the machine name and the machine has basic network capabilities and e-mail working, you can do something like this:
Code:
|
Asserting similar but w/o the mailx package:
Code:
#!/bin/sh (I think im going to have to add mail to tthe kernel) If you succeed please post how. I've never seen mail added to the kernel and I wonder if that chimera would be worse than a crossover between say The Fly II (1989) and Lassie (say 2005) ;-p |
I think this is going to get better as i go.. i wanted something small (or so i thought) however i think its getting more advanced. Your ideas are great and will be applied... in the end here is what im wanting to do.
find the computer info stored in zisview (zenworks) cat zisview >> /tmp/zisview.txt dd if=/dev/zero of=/device hexdump -C | grep '1' (this makes sure there is nothing but zeros on the drive) somehow verify that its all 0's grep /tmp/zisview.txt for the info such as NetBios Name: then whatever the name is, put that into a $machine name variable somewhere, take that and email it to said person@smtpaddress doesnt sound so simple now that i write it out.. especially when im not a good bash scripter. |
Well, since you didn't specifically *ask* for a script here's some Bash scripting guides to chew through:
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html http://www.tldp.org/LDP/Bash-Beginne...tml/index.html http://www.tldp.org/LDP/abs/html/ |
okay, ill specifically ask... could someone find the time to write me a script? that would be nice..i would buy them a pizza or something!!!
Heres what i have so far: #!/bin/bash DATE=$(date) RESULT="HD Wipe Complete" MACHINE="grep -i 'NETBIOS_NAME=' /tmp/machine.name" NAME="cat /tmp/machine.name" dcfldd if=/dev/zero of=/dev/sda | dcfldd if=/dev/urandom of=/dev/sda | dcfldd if=/dev/zero of=/dev/sda | dd if=/dev/sda | hexdump -C | grep '1' mail -s "Hard Drive wiped for $NAME" person@place.com <<EOM The remote wipe command was issued for $machine & $name. The script returned the status: $result end of message. EOM booyaa ps. thanks for the links as well.. ill read them |
pretty please could someone make me a wikked script? hehheeheh
|
All times are GMT -5. The time now is 07:58 AM. |