Am using the below script to send mails as an sql output . but the below script sends the generated file even if it is empty (if there is no outputs generated from the sql command) .
I want to send mail only if the file has some valid outputs. How to do this
I am looking for a way to be mailed a new file when it is created in a certain directory.I have found tools that will notify me when a file is created, such as iWatch with iNotify, but is there a way to actually be sent the new file when it is created.It is only a short text log file, but I would like to read it in my inbox rather than have to login and open the file each time an event is logged.
How can I split my local mail box into an individual files for each mail. The senario of mine is I fetch some emails from a mail server into my local linux box with fetchmail command but I want each fetched mail in a different indivitual file for easy file processing and manipulation for example sending those email through sms and so on
What I would like to do is to print the contents of all text files in a particular directory, recursively. Problem being that there are directories and possibly binaries scattered around in the filesystem as well.
Trying cat * works as long as there are no directories in there, but when there are it gives an error instead and prints nothing.
I'm sure it's easy using file -f or something but I can't figure it!
Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .
I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.
I want to create a mutiple output files with each file having a seperate code which is stored in text file and create XYZ_222_999_YYYYMMDD_1.TXT . and add date in the contents next to series of numbers .Like this
I have setup a postfix mailserver and it seems to be working ok, we are only using this to relay mail to our forum users. Its not being used to recieve any email only send them out to the internet.
What is the difference between the mail.log and mail.info files? Can I turn one or both off? I see alot of messages like...
Just wondering what this string of log entries means? Also I am getting duplicates in the syslog file as well.
I cannot get exim4 to actually deliver any "local delivery only; not on a network".But whatever I do in the config, all mail gets frozen with entries in the log file like:"root@empty R=nonlocal: Mailing to remote domains not supported"Maybe the problem is that there is no fqdn for the computer (and will never be). How can I enable local mail delivery?
I have to administer a few mail servers, a mail log server, 4 nameservers and a web server -all running on Centos 5 server distributions. Now I have a task: to avoid accidental crashes on the production servers while installing updates, my boss asked me to do clones (these clones will all be VMware virtual machines) of the servers (EXCLUDING the actual e-mails and mail log contents) and then to run those clones on VMWare Server. This way, first I will install and test updates on the clones and - if they will be running without crashes - I will apply the updates on the real production servers themselves. I have already installed VMWare Server 2.0 I have a few questions:
- How do I build the virtual machines to exclude the actual mail files and mail logs? Can I use VMware Converter for this purpose, or do I have to use another program? - How do I actually do this cloning? Is there a tutorial on how to do this?
Recently, my hard drive crashed. I was using XP and do not have my install discs (lost them 3 moves ago...). I make backups regularly and only lost roughly 3 days worth of material (nothing really important). On my other PC I've been running linux forever. I don't need windows and have installed a new HD in the PC and put fedora on there w/ no issues. Now historical email. There seems to be many workarounds for getting dbx files to mbox inside windows, but how would I accomplish this task without a windows install anywhere (Virtual installs are out as I do not have any install discs for windows anyways).
After a quick search, I only found one possible solution (in perl) and am looking for something that I don't have to program my self. I am a programmer by trade but have never programmed in perl (c++, FORTRAN, matlab, python... yes) and at this point, don't feel like learning new syntexs for this one problem (python has been my goto scripting language for everything linux...). Also if anyone has a link to a c++ lib(link to documentation?) that does the same thing... I might take a look at that and make a gui for it... then release it for others...
i just want to know,how can we edit the files of /bin folder. for ex: we have a file named mkdir which is being executed when we run the mkdir command at the terminal. I just want to read the code inside that mkdir file. That binary file has to be converted to text,which should be human readable.
What bash command can I use to rename or change the extension or name of a batch of files (for example, from .php to .html)?
Furthermore, is there a simple bash or python script/command that can be used to open a batch of plain text files one-by-one, search for all instances of a specific word, and replace all of those instances with another word?
I started my computer and i goto home/downloads. i found all downloaded are deleted. and every folder and file in home folder are displayed in desktop.
I have got a nagios server running on my network, The configuration seems to be okay but each time there is a service alert notification, and an e-mail is sent to the contact group, Nagios continuously sends e-mail over and over again. Do anyone know of a way to set Nagios directives to only send one e-mail per alert without it flooding mail boxes.
I had configured sendmail on linux 5.2, Iam using public ip and my domain is registered[linuxforfreshers.info]. I am facing a issue that when I mail with the user sumit@linuxforfreshers.info then I am able to do it. But if somebody tries to send mail to the same user then it bounce backs. I had made the entry of domain in /etc/mail/local-host-name and also I put ok in /etc/mail/access.The mails are working properly with in LAN. But not able to work on WAN only I can send mail but not able to recieve mail.What else I need to do.
I need help in setting up the native e-mail client included in Debian Squeeze. My ultimate goal is to have the Debian e-mail client download e-mail messages and process attachments automatically.
I just want to know is it possible to extract a single mail from the mail path i.e. /var/mail/root.
for ex. i am having this mail in /var/mail/root.
From root@localhost.localdomain Thu Mar 10 21:47:47 2011 Return-Path: <root@localhost.localdomain> Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.13.8/8.13.8) with ESMTP id p2AGHlx4004190 for <root@localhost.localdomain>; Thu, 10 Mar 2011 21:47:47 +0530 [Code]....
I have configured fetchmail, sendmail/postfix and mutt to act as a relay to receive mail. I can receive mail fine but I cannot send mail. Its working fine on my one box but on the one acting as a nat I am having issues. This is my mail log from the nat box.
I came across this feature of the "less" command today. It appears not to be well-documented so I'll share it here. I found that "less" can automatically uncompress compressed files - no need to run the first command, the second does the same job:
Code:
gunzip -c textfile.gz | less less textfile.gz
Even better, "less" can read and list the contents of some archive files as well, including Tar files compressed using Gzip and Bzip2 as well as Zip files. So now when I want to list the contents of an archive,for example to determine whether the contents will be extracted to an absolute path or relative to the working directory, the following work
Code:
less archive.tar.gz less archive.tgz less archive.tar.bz2 less archive.zip
Much easier than remembering the various options that the Tar, Gzip, Bzip2 and Zip use. The best one for me is with RPM archives:
Code:
less some.rpm
The above outputs the Information, Change Log and verbose File List of the RPM (paging the output, of course!) The following commands (using short and long options) give the equivalent output using the "rpm" command:
Code:
rpm -qilvp --changelog some.rpm | less rpm --query --info --list --verbose --package --changelog some.rpm | less
"less" does not recognise the initramfs file produced by "dracut" (which is a compressed "cpio" archive), but I suppose you can't have everything ...
When I run "ls -al somedir*" (I use the "ll" shortcut, actually), Linux not only list files that match, but also the contents of directories whose name also happens to match.Is there a way to limit "ls" so that it will only show names (files and directories) and ignore the contents of the directories?
I have two servers relavant here: mail.domain.com (1.1.1.1) - which is the nameserver and the mail server for domain.com. www.domain.com (2.2.2.2) - which is the www subdomain for domain.com domain.com (cname www.domain.com) - an alias for www.
The zone file for domain.com lists mail.domain.com as the MX server for domain.com. 2.2.2.2 is actually being served web pages as a virtual host. It's real hostname is www.anotherdomain.com. Mail for domain.com works pretty well, in general. However, if I attempt to send mail from www.domain.com (or its alias domain.com), I get "mail for domain.com loops back to myself" in the postfix logs. On 2.2.2.2 /etc/postfix/mail.cf has mydestination = www.anotherdomain.com, localhost. How do I tell postfix on 2.2.2.2 that mail for domain.com needs to be delivered to mail.domain.com?
I am trying to use "hexdump" on the files in the /dev/ directory. This is ubuntu 9.10.There is some more in this forum: [URL]Hexdump returned small blocks of bytes or couldn't see the files even as root. I expected to see the actual data streams from the various devices. How come this doesn't work?
There is one SVN server that I configured and is running fine. Its working over WebDAV on http. People can see the repositories and all. Now, I have created on repository and I want to add code to it which is not present with the developers as well. This is code is on some other test machine. It is not used for development but is test platform. Is there any way of transferring this code to the repo without developers copying it to their systems?
In Ubuntu 10.04, there is a certain file that appears highlighted in terminal. When I try to cat the file, it says there is no such file or directory. How can I see what's in this file? Is this a symbolic link?