1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | sub Mail_Mailer { my $destination_directory ='/data/'; my $from_address = "abc@gmail.com"; my $to_address = "abc@gmail.com"; my $subject = "SOFT DATA "; my $body = "Dear Sir\nPlease find the complete set of data on sftp\n."; my $cc="test@gmail.com"; opendir (DES,$destination_directory); my @files=readdir(DES); close(DES); my @mail_sent_file=@file; foreach my $mail_file_names (@mail_sent_file) { $body=${body}."\n".$mail_file_names."\n"; } $body=${body}."\nRegards\nreportsadmin."; my $mailer = Mail::Mailer->new("sendmail") or die; $mailer->open( { From => $from_address, To => $to_address, Cc => $cc, Bcc => $bcc, Subject => $subject, } ); print "Going to send the mail."; print $mailer $body; $mailer->close(); print "Mail sent."; return ($mailer); } |
In MySQL user always tries to connect with the server via command line interface such as remote login like 'ssh' then they troubled themselves in using graphical interface and get the required output quickly. So they need to automate that task. In this Blog I am going to suggest you a way to do this ... First of all we need to know that a MySQL service is kept in /etc/init.d/mysqld and we need to invoke that in order to use mysql server and client. To do this use following command in terminal : service /etc/init.d/mysqld start or service mysqld start When mysql server is started make a directory like /home/anduril/shubham_Script and after entering into that directory use this command in your terminal. vi connect_string.sh It will create a file with the name connect_string.sh you can give any name you want. Press 'i' to edit and enter the following text : mysqlshow -u root -proot mysqladmin version -u root -proot mysqladmin variables -u root -proot mysqladmin ping -u roo...
Comments
Post a Comment