General :: Unix Script That Executes Sql Query In A While Loop?
Jan 8, 2011
I have a logfile which looks like:
tableabc 1786rows
tabledfg 8374rows
tablefhd 726rows
[code].......
Now i have to writ a script which takes this log as input and quesries the DB for each table. So,I want to: input the logfile
start a while loop.So,while read LINE This variable LINE would store the table name by CUT using a delimiter once the table name is ready it makes a connection to DB and queries the table for its rowcount writes the rowcount to an O/P file.
View 3 Replies
ADVERTISEMENT
Jun 28, 2010
Quote: select * from s_transaction Where between UNIX_TIMESTAMP('2010-06-28 15:40:00') and UNIX_TIMESTAMP('2010-06-28 16:00:00') and user_id = '15545941';
Is this the syntax correct to retrieve a particular user transaction between given time period? because "its return error check the syntax near the between"
View 3 Replies
View Related
Sep 1, 2010
I have a mytext file with month and year as two separate fields. likemytext fil
08 2010
09 2010
10 2010
........
........
........
I want to read the values of each field i.e., month and year into an awk script.
View 10 Replies
View Related
Jul 28, 2011
I have a hard to reproduce (seen a couple times in a month) issue where my program seems like it is hung (not increasing in cputime), however, it is in the runnable state and never gets to run. The cpus are 99% idle according to vmstat and the load is 5 (which is equal to the number of threads in my program that are in the R state) according to ps, and there are no processes on the system in the 'D' state. The other major oddity is that one of the migration threads has a cputime usage almost equal to the uptime of the system. Typically migration threads have a cputime on the order of seconds across hundreds of days of uptime, but in this case the migration thread has DAYS of cputime according to ps.
The last time this happened, I went around saving as much /proc/X information that I could into logs for referring to later, before I had to reboot the box to get it running back to normal. (because in this state, a kill -9 is not heeded by my program)Does anyone have any idea what could cause this? I am not sure if this is a scheduling bug or a bug in my program (the likelier case).I have a wealth of logs to look through if anyone can suggest something specific to look for.
View 4 Replies
View Related
Dec 6, 2010
I am trying to create a script that creates a vector and displays it. I used the command inivec but it didn't work.
[code]...
How do I make it so the terminal executes mi script to create a vector. I know MV is the name and the output should be aa aa aa, but nothing?
View 3 Replies
View Related
Aug 27, 2010
Iv got an assignment to complete and I'm stuck at the basic level.
A part of the assigned problem is :
The main process will read the file, and will create N number of child processes (Where N is taken as input) as early as possible before all the children starts its execution. Before creation of each child, the main process should read the file to store all the required data in then corresponding data structure. Child processes should not read the file for getting their information.
As far as my knowledge about this , the child executes before the parent. How do I make the parent not pass the control to it's children before it finishes creating all the children?
View 3 Replies
View Related
Jan 5, 2011
I am trying to write a script that connects to a server and executes some commands on there. Something like this:
#!/bin/sh
telnet remote_machine
cd /home/some_directory
cat a_file_in_current_directory
Unfortunately after login/password I guess the script doesn't jump past the telnet command, until I exit. What do I need to do to make the script start executing commands in the remote shell?
View 1 Replies
View Related
Apr 4, 2011
I'm writing a bash script that executes a few perl scripts. One of the perl scripts that I need to execute requires two arguments with it. The arguments are stored in a txt file, each line contains a hostname and its corresponding IP address separated by a ":" (colon), the txt file looks like this below:
[Code]...
I'm not sure if it's the best way to accomplish this but here it goes. In the bash file, let's call it getHosts.sh, I create an array and assign each line of the file to an element in that array. I then think I need to create a new array where I take the hostname (which is before the ":") separate it from its IP address and place the IP address on a new line just below the hostname (this way I can reference to it like $hostNames[$x] would be the hostname, and $hostNames[$x+1] would be its IP address). So the new array would now look like this below:
[Code]...
View 4 Replies
View Related
Oct 2, 2010
My goal is to download a .deb package(e.g vlc) from the cmd line so that I do not always need to connect to the internet using the normal apt-get install cmdFrom the cmd line I typed sudo apt-get -d install vlc. After the operation is completed, is the downloaded file in a .deb form and where is it downloaded to?
View 3 Replies
View Related
Jan 9, 2011
I have an application in my company PC running on Fedora Linux.Can dyndns be used to access from outside world?
View 5 Replies
View Related
Sep 2, 2010
I'm using Net::Bluetooth to create an RFCOMM socket on my Linux box. I need for it to register with SDP with a specific UUID. The perl code can be viewed in this link. I am unable to make the connection from a remote device however. This remote device (my Android phone) is able to connect to other RFCOMM devices using this UUID. I would like to troubleshoot the problem, but I can't find a way to browse the LOCAL SDP records of my PC where the Perl script is running (and waiting for incoming BT connections). how to browse the SDP records on the local PC?
View 1 Replies
View Related
Aug 4, 2010
I configured ldap server & client on centos,then i connected centos and suse with network.now want to get group of any user from this server via suse.is it possible with perl scripts? or i need to install other modules on suse or centos?(such as : pam,nss)
View 8 Replies
View Related
Jan 28, 2010
i want to know how to view tamil websites in redhat linux EL5.pls assist to know the detail.
View 5 Replies
View Related
Sep 16, 2010
how to applied permission on /etc directory. i want to deny all permission except me(owner).....is this possible?
View 1 Replies
View Related
Sep 21, 2010
I have the following mysql query which works great.
Code:
SELECT msg FROM `logs` WHERE ((`host` = 'aaa.bbb.ccc.ddd') OR (`host` = 'aaa.bbb.ccc.ddd')) AND `msg` REGEXP CONVERT( _utf8 'physical addresses' USING latin1 ) COLLATE latin1_swedish_ci
I need to refine this query so that I can query the last # hours using the `datetime` field in the database. I have researched the DATE_SUB function and can query for example the last 1 hour like this:
[Code]....
View 10 Replies
View Related
Nov 4, 2010
i have a server which was handover me, it has redhat 4 u3.but i cant find the machine model no, it is hp g4 server, so this info from linux where can i see
2nd if i want to know what is the bios version and date how can i see from linux.
3rd if any hardware failing like network card, ram memory, hard disk how we come to know hardware.
View 5 Replies
View Related
Jan 17, 2011
I am on a CentOS 64 bit and used webmin to rotate MySQL slow query log. Now the thing is although logs are being rotated daily but the new log files being created are empty which means MySQL is unable to write them due to some reason. I have checked using "ls -l" that both permission and owner of files is same but still MySQL is not writing logs. What could be the reason?
View 10 Replies
View Related
Jun 9, 2010
I have Fedora11 machine : 192.168.0.3 ( Bare metal )--> vinay.linux.com
Another Fedora 11 machine : 192.168.0.4 ----> test.linux.com
Virtual Machine on FC11 : 192.168.0.6 ( VM )-----> centos.linux.com
I have DNS configured on Fedora11 machine, Also I have checked the connectivity of centos.linux.com to port 53 of DNS.
Here is my /etc/named.conf file of FC11 machine code...
View 2 Replies
View Related
Dec 30, 2010
I have a ClarkConnect (CentOS based) box running as my home router on a RR connection. I had the DNS servers set up to use Google's DNS server. I want to change them back to the local DNS servers but I can't find an obvious/easy way to get those address short of a) reconfiguring the router's network to DHCP them (would rather not interrupt everyone) or b) calling their tech support (kill me now!). Is there a command line tool/command I can use to query the DHCP server on the external NIC to see what DNS servers it would set me up with w/o munging my existing setup?
View 1 Replies
View Related
May 24, 2010
This query is giving "Unable to open data base" can anybody suggest what's wrong with this query.
sudo echo "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url
FROM moz_places, moz_historyvisits
WHERE moz_places.id = moz_historyvisits.place_id;" | sqlite3 moz_places.sqlite, moz_historyvisits.sqlite
View 1 Replies
View Related
May 25, 2011
I am connecting to MySQL DataBase using shellscript and writing a select statement like select attachmentid from attachments where pageid=10175 I want to store the output of the select statement into a shellvariable or a file. How can i do it using shellscript.
View 4 Replies
View Related
Mar 17, 2011
I want to install mysql query browser in debian
View 1 Replies
View Related
Apr 20, 2010
Is there a command that can tell me which binary actually executes for some program name? "whereis" seems to do something different.
Specifically, I am trying to hunt down and kill a python 2.6 installation that just won't die.
whereis just seems to be returning anything with "python" in its name, but I want to know which binary thinks it is python 2.6.5. (By the way, I've tried all the above manually, and it isn't any of them)
View 6 Replies
View Related
Mar 14, 2010
I am using "if" to force a word under the condition that the first letter of that word must be a letter of the alphabet, regardless of capitalization, using the " "" != "" " syntax.
Like so:
Code:
if [[ "$interface" != "WHAT DO I PUT HERE?" ]] ; then
echo "Invalid input"
exit 1
fi
View 5 Replies
View Related
Mar 9, 2011
I have inherited our Linux packaging and as the number of versions increase, the number of conflicts is starting to get a bit unmanageable. I believe the easiest way would have been to keep the package names the same and just change the release in the spec file but unfortunately I am past that as a lot of these packages are rolled out to our estate. (I am told there were reasons for not keeping the package name the same and incrementing the version/release)
Is it possible to wildcard conflicts so I don't need to keep adding as new versions are created. For example, instead of using all the conflicts below, have something along the lines of AAtest45* <= 1.4 & BBtest45* <= 1.4 Meaning that all I would need to do was change this to 1.5 at the next release (the packages below version matched the release in the spec file)
[Code]....
View 2 Replies
View Related
Nov 17, 2010
I am running Ubuntu 10.04 LTS. I am trying to run a query browser for mysql but keep receiving the following error:
X11 connection rejected because of wrong authentication.
The application 'mysql-query-browser-bin' lost its connection to the display localhost:10.0; most likely the X server was shut down or you killed/destroyed the application.
In ssh_config, I do have ForwardX11 set to yes.
View 4 Replies
View Related
Feb 23, 2009
i have been using samba to gain access into windows computer through my pc which has fedora 8 ..can i access the unix machine from another unix machine? is yes then what is the procedures ?
View 4 Replies
View Related
May 6, 2010
I'm having trouble getting conky to boot friendly-like with the gwm. If I just set conky as a start up program, it floats above other windows, it seems to have loaded before the desktop actually did. So I googled it and found that many people use the conky shell scripts to make it sleep until the desktop load. I created one, made it executable, and restarted to see the effect and found that conky never launched at all (not visible, no running process).
Here is my startup shell script for conky:
Code:
#!/bin/bash
sleep 10 && conky;
This is how it should look if working properly. If I launch conky after login, it looks like this every time. [URL]. This is how it looks if I simply set it to open upon startup with no script. [URL]. If I try to open it with the script, I simply never see anything in conkys place. It seems like the script never executes. I've tried setting longer and shorter sleep times, but I never see so much as a single instance of conky running.
View 8 Replies
View Related
Jun 7, 2011
I completely switched to Ubuntu 6 months ago. I kept my secondary sata hd as ntfs for a while but started having permission problems. I switched it to ext4 and that worked for a while but then it started having permission problems again. Specifically, I can't execute anything on that hd drive. I converted it to ext2 and it still didn't help. I have 2 executable modules that I moved up to the root directory to make this simple and they look like this:
tom@tom-desktop:/media/sda1$ ls -l
total 3088
-rwxr-xr-x 1 tom tom 3099451 2011-04-23 16:36 bochs
-rwxr-xr-x 1 tom tom 26064 2010-09-11 08:48 bzip2
[Code]...
View 6 Replies
View Related
Nov 5, 2010
I just purchased a new server and loaded it with Ubunut server 10. I installed apache2, php5, and mysql5. apache needs a little bit of configuration left (I need to tell it to accept index.php in addition to index.html), but other than that, all the php is working. MySQL is working as well, at least on the server. If I do a "show databases;", it shows all the databases properly. I loaded phpmyadmin on the server for testing, but I'll be removing it once everything works - this is my production server. phpMyAdmin can find all the tables, perform successful queries, and do everything I want it to, HOWEVER If I try to use the login page, I get the error mentioned in the title of this thread.
The database is a carbon copy from my development server, which works flawlessly. All the php and html pages are exactly as they are on the development server too, yet I still get that error. I've reloaded all pertinent programs (apparmor, apache2, and mysql). Apparmor was because I had to declare some new lines for mysql to access a different location for the DBs I resolved the "can't load InnoDB issue", but this one is stumping me.
View 1 Replies
View Related