Programming :: Taking Back Up Of Log File For Running Process?
Feb 16, 2010
I am working in HP UNIX. I have one process which is running continuously.There is log file generated for the process. I want to take back up of file without loosing any logs after particular interval of time or say file size increases more that 1GB.
View 3 Replies
ADVERTISEMENT
Sep 15, 2010
I have cronjob that uses rsync to back up to a remote directory every hour. how do I set this rsync up so that if initial process is running already, it prevents running same rsync command and checks again in next hour until the process is finished/terminated?
View 5 Replies
View Related
Jan 12, 2010
in bash scripting...say I want to take the input from a user via a question...I would do this:
Quote:
#!/bin/bash
echo "How large do you want this partition to be in GB (enter only the number)?" read PART_SIZE echo "You want your partition to be $PART_SIZE GB" But I don't want to echo it back to the screen, I want to add it to the content of /etc/fstab. I have been mucking around with sed to find the tmpfs partition in /etc/fstab and add the partition size attribute (this is to use the onboard RAM as a volatile partition)...but am not having any luck...
The portion of /etc/fstab that uses /dev/shm for the tmpfs partition is:
tmpfs /dev/shm tmpfs defaults 0 0
So, if a user says "24" GB to the answer (from above), how do I get it to automatically add that value to the tmpfs partition line in /etc/fstab? So it would look like:
tmpfs /dev/shm tmpfs size=24g,defaults 0 0
I understand that I would also have to come up with a way to put "size=XXg", which I could do with a copied over generic file before this action...then the script would have to find "XX" and replace it with the user's figure...
View 7 Replies
View Related
May 2, 2010
Whenever I'm running my application process, I've 1M physical memory usage is increasing for every 2 hours.This I observed using 'free -m' command.But 'top' command did not showing any increase 'RSS' size.It is same as it was started initially.Even though I stopped my process,the increased memory was not released back. If I start my application process then again memory usage start increasing by 1M for every 2 hours. increase of memory usage observer with 'free' and that too when my application is running, but top command is not showing any change in the RSS sizeIf my application is leaking any memory which is allocated by new/malloc, that should be released back whenever my application exit and the size increase will be show through top command for that process, right? This is not happeningThis proves that there is no potential leaks in my process.But why physical memory is increasing when only my process is running?
View 14 Replies
View Related
Jan 27, 2010
How to get list of threads of a process using C code in Linux?
View 6 Replies
View Related
Sep 7, 2010
In the comments section of this blog, the commenter "Pratik" claims that you can edit a running bash script, without killing it, and have the changes picked up by the running script. He claims you can do this by editing files in /proc. Now, I know how to find the /proc folder that contains the data on the running process, Code: cd /proc/`pgrep process_name` But I can't figure out what I should do if I want to edit a running bash script.
View 6 Replies
View Related
Jul 11, 2011
I have a requirement where I want to extract the full name of the process running in my box. I tired various options of ps. The wide option gave me the full command but that contains command, the interpreter and also the arguments passed.
Code:
XX XX XX XX XX XX /usr/bin/sh /path/to/exe/myexe.sh arg1 arg2 arg3.
Is there any way from ps or any other command I can extract the full name of the command
Desired Output :
Code:
/path/to/exe/myexe.sh or myexe.sh
View 12 Replies
View Related
Aug 18, 2009
is there a way for me to grep the process that running more than 30 days only using linux command or script?
example:i do ps -ef to list out the process, then i want to filter only the process that always running more than 30 days..
View 8 Replies
View Related
Apr 15, 2009
I need a help regarding ,how to shutdown the running process using C program?..here i attached the porgram to shutdown the system by c program is there any possible to change in this program to shutdown the process?
View 1 Replies
View Related
Aug 18, 2009
I have p1,p2,p3,p4 some processes created by me in C. p1, p2, p3 are started individually from several consoles. And I want process p4 to terminates processes p1, p2, p3 if they are running. Which is the easiest way to accomplish that? put all processes in the same process group and send from p4 a kill signal to the group. But I couldn't do that because I cannot call successfully setpgid(getpid(), 15000) from p1-p4. It's there some way to put them in the same group? the processes don't have a child-parent relationship, they are launched manually from consoles.
View 1 Replies
View Related
Dec 4, 2010
It's called TextRipper and it creates indexable and editable text files from any image. Feel free to copy TextRipper; it's licenced under GPL. My troubles are with cracking passworded pdf's. (As you can see, I meant any when I said any image.)
I can't find a way for the user to cancel the decryption process by exiting the script without pdfcrack orphaning. Line 349 works the rest of the time; the concerned process is line 228. I believe it's a piping/subshell problem. At least that's how I've been going at it in vain.
I've made portability a priority and that the comments still require updating.
Code:
If the result is one output file, TextRipper will open it for you in OpenOffice Writer.
Otherwise all txt output files (editable and indexable) will be in the original file's directory." 0 0
View 14 Replies
View Related
Feb 10, 2011
I have an ubuntu 10.10 server and want to run a script on it to check if a process is running. If it is not running, it will start the process and also write into a log file.
When running the script i get the following error message:
syntax error near unexpected token `else'
Here is my script.
View 7 Replies
View Related
Mar 18, 2010
I have just installed Ubuntu for the first time using a USB drive and everything went fine during installation. However now during the boot phase I see 10 or so lines of
[14.24024] ata5: COMRESET failed (error=-16)
The numbers prior to COMRESET change with each line but the rest remains the same. I am extremely new to Ubuntu or Linux for that matter as this boot process is also taking about 3-4 or even 5minutes as it slowly cycles through each error. Once 10 or so lines have popped up the computer finishes starting and I can log in fine and everything.
View 1 Replies
View Related
Jan 19, 2009
if my network downs my system process get slow down ... only in user mode but in root it is working fine ..the process slow especially if i try to open a terminal or run any gui application its taking much time comparing to normal time where network is up ..
View 2 Replies
View Related
Jan 4, 2011
I have a script can process input text file and find out 3 values called positive, negative, neutral. Now, I have a new input file which contains some text called 'content' and I need to use the above script to get three value positive, negative, neutral for each of this 'content'. The content is text in many lines and bounded by two tags <content> and </content>
The input file could have this format:
<example>
<input>
<id>abcdef</id>
<content> line1
line 2
[Code].....
Do you think that is possible to write that in Linux ? I have the feeling that using Linux with text finding, replacing much shorter and easier(when I have to write long and complicated code in other languages), so really want to learn how to use it from here.
View 14 Replies
View Related
Jul 9, 2010
I hade created a file with following text entries.
content of fileitems.txt
kdeaccessibility-4.4.92
kdeadmin-4.4.92
kdeartwork-4.4.92
kdebase-4.4.92
How do I read the file one line at a time and so its ready to do something with that line.
View 3 Replies
View Related
Jul 24, 2010
Having several distros on my computer (including Windows), I prefer BING (BootIt NG) as an overall boot manager. This way, I just install a distro together with GRUB to its dedicated partition, and keep full control over what partitions are available/visible and bootable when family members use the computer.Yesterday, I tried to update Lucid (Ubuntu 10.04) and got a problem with the newly available GRUB (1.98-ubuntu7): it said that installing GRUB to a partition was a "BAD" idea, and, luckily, refused to update. I've noticed this behaviour during my last install of Sidux (great distro to keep track of what's happening at the KDE front, by the way). Same problem, same message. Result: no more new Sidux releases...
What's going on? Is this intended behaviour and thus making it impossible for people to manage their booting their own way? Are we talking about a bug here? There seems to be a mentioning of this behaviour on Launchpad, but it's unclear whether it's a bug or not; at least to me.
View 9 Replies
View Related
Oct 15, 2010
I do use a virtualization environment using VirtualBox,Qemu. Many a times I have to format my laptop then in such situations installing again the previous programs and making same changes to the configurations is very painful. Is there some way I can make some sort of backup which I just need to install on my existing system and get all previous things immediately installed without going to install and setting of a lot of other applications and settings.
View 1 Replies
View Related
Oct 26, 2010
I need to process a log file on an hourly basis but the log only rotates once a day.Basically, I am trying to get the difference between the previous file and the current file based on datetime. ie. The new file's datetime events > previous file's datetime events.The first field in the files is datetime.
Code:
2010-10-27 01:57:32,aaa.bbb.ccc.ddd,host1
2010-10-27 01:57:32,aaa.bbb.ccc.ddd,host2
[code]...
View 4 Replies
View Related
Mar 8, 2011
I need to disable file access (fopen, freopen, open etc) for application which is running under chroot jail and with restrictions (rlimit) via execv. Before that I redirected stdin/out to files within jail. I tried this:
Code:
// Redirect stdin/stdout to files
int fd = open (file_input, O_RDONLY);
if (fd < 0)
fatal_error ("input open failed!");
[Code].....
View 6 Replies
View Related
Apr 27, 2010
Assume someone bind a particular process to a particular CPU core(In multi core machine) by using sched_setaffinity() like functions. Then how we can get that process running core id and CPU core utilisation of that process on that running CPU core(Pragmatically or by a Linux command)?.
View 5 Replies
View Related
Aug 6, 2010
Sometimes I connect to my Debian box from another computer (using SSH on Cygwin or Linux), and once ina while I want to run some console apps. And sometimes some of these apps might complain about "another intance, Error: an instance of newsbeuter is already running (PID: 2496)". Is there a work around for this issue at all(without killing the original instance") ? The reason I do not want to kill the app because there might be 2 users connected to the same machine that might be using the same app.
View 1 Replies
View Related
Feb 10, 2011
how to run a shell script taking command line arguments in a jsp page.
View 1 Replies
View Related
Apr 1, 2011
I have written a small script from that iam appending the output to a file.If multiple users invoke the same script or if i invoke the same script n number of times (using &), the output file(ZZ/OUT) contains messup information.
++++++++++++++++++++++++++++++++
#!/bin/bash
#
[code]...
View 3 Replies
View Related
Apr 15, 2010
Running first upgrade after installing 9.10.
Currently on item "Configuring linux-image-2.6.31-20-generic" and the progress bar/terminal readout has not changed for an hour or so I'd say.
Don't want to cause issues by killing it halfway through, especially as it presents an opportunity to learn something!
View 2 Replies
View Related
Mar 26, 2010
Brand new to Linux. Sort of got thrown in front of the bus if you know what I mean. The company I work for has a Linux server running CentOS 5.4 Company uses Linux for their Email, FTP and Web Server. Have been here a few years dabbling in and out of Linux and now that the old Admin has left the company.....I need to learn it ASAP. The server has run pretty solid until today.
The email server runs SendMail and SpamAssasin. Received lots of complaints today regarding extra SPAM. Noticed that SpamAssassin was not running. Tried to restart it through the WebMin tools and got the following error: Starting spamd: child process [3956] exited or timed out without signaling production of a PID file: exit 255 at /usr/bin/spamd line 2588.
View 1 Replies
View Related
Jul 12, 2010
I would really like to preserve a file's original modified date and pass it back to the file as the same attribute after a script has worked on it. I get a lot of JPEG files from different places on the Net which I either turn around and upload or burn to disk, and having the "original" date of either download or last mod in a graphics app would be for me, in the long run, a lot more helpful when deciding, for instance, which files to "recycle" or pass on backing up more than once.I've tried doing this on my own every now and then. Where I run into problems is that it appears "stat" and "date" use different formats for date information, and I can't seem to puzzle out how to "translate" one to the other satisfactorily for the latter command.
Just to give an example:
stat foo.jpg |grep Modify gives me
Modify: 2010-07-12 06:28:56.890625000 -0400
Passing that string as-is to date foo.jpg, I get the errordate: unknown option -- 0 and the usual semi-courteous suggestion to Try 'date --help' for more information.Somehow my TexInfo database got screwed up somewhere along the line and info dategives me the short article on date input formats, not the full documentation for the command
View 4 Replies
View Related
Nov 9, 2010
I have a shell script to identify whether the process is running or not. If the process is not running, then I execute another script file to run my application. Below is my script and saved this script as monitorprocess.sh Code: #!/bin/bash
result=$(ps -ef | grep -v grep | grep "applicationname.sh" | awk '{print $2}')
echo $result
if [ "$result" == "" ];
[code]...
View 4 Replies
View Related
Mar 31, 2011
Is there any difference in cpu usage for process in init.rc(runs automatic when boot is happened) and manually running process. Will these both have same priority by default...?
View 1 Replies
View Related
Nov 26, 2008
I tried googling but didn't get any answer for this.I have a process called "abc" and it is running with PID "123".I have a putty session opened with PID "999".I am giving kill -TERM 123 from putty session.My process "abc" before dying it should catch the PID of the terminal which provided TERM signal to it.Is there any way to find this out
View 2 Replies
View Related