Ubuntu Servers :: Limit Size Of Log File When Redirecting Stdout?

Jun 7, 2010

I have a command line server that logs to stdout, which I start along the lines of ./server > log.txt

What I want to do is limit the size of log.txt, without modifying the server.

I am assuming there must be some kind of tool already that lets me do this, something like where I can pass in my server, the output file and a size limit? If so, can anyone enlighten me?

View 3 Replies


ADVERTISEMENT

Programming :: Redirecting Stdout To File And Terminal And Stderr To File?

Apr 20, 2010

I have a script where I want to redirect stdout to the terminal and also to a log file aswell as redirecting stderr to the same log file but not the terminal.I have the following code which I found on the net which redirects both stderr and stdout to a file and the logfile,

Code: if [ -p $PIPE1 ]
then
rm $PIPE1

[code]...

View 3 Replies View Related

Ubuntu :: Redirecting Iwconfig - Eth0 - Has No Wireless Extension Are Still Outputted To The Terminal (stdout)

Mar 11, 2011

When iwconfig is redirected thus Code: iwconfig >> wireless.txt things like Code: eth0 - Has no wireles extension are still outputted to the terminal (stdout)

View 2 Replies View Related

Programming :: Redirecting Stdin / Stdout And Stderr For Program Run As Fork()/execl()?

Nov 24, 2010

I'm trying to write a program that will fork a series of FTP sessions. For each session, there should be separate input and output files associated with stdin and stdout/stderr.
I keep reading how I should be able to do that with dup2() in the child process before the execl(), but it's not working for me. Could someone please explain what I've done wrong? The program also has a 30-second sniper alarm for testing and killing of FTPs that go dormant for too long.

The code: (ftpmon.c)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

[code]....

The output:

$ ftpmon
Connected to gila-crstest.gilacorp.com (172.16.20.8).
220 (vsFTPd 2.0.1)
ftp> waitpid(): Interrupted system call

Why am I getting the ftp> prompt? If the dup2() works, shouldn't it be taking input from my script and not my terminal? In stead, it does nothing, and winds up getting killed after 30 seconds. The log file is created, but it's empty after the run.

View 3 Replies View Related

Programming :: Redirecting Stdin / Stdout And Stderr And Finding Files Name And Other Stats?

Aug 8, 2010

I'm working on an application used for backup/archiving. That can be archiving contents on block devices, tapes, as well as regular files. The application stores data in hard packed low redundancy heaps with multiple indexes pointing out uniquely stored, (shared), fractions in the heap.

And the application supports taking and reverting to snapshot of total storage on several computers running different OS, as well as simply taking on archiving of single files. It uses hamming code diversity to defeat the disk rot, instead of using raid arrays which has proven to become pretty much useless when the arrays climb over some terabytes in size. It is intended to be a distributed CMS (content management system) for a diversity of platforms, with focus on secure storage/archiving. i have a unix shell tool that acts like gzip, cat, dd etc in being able to pipe data between applications.

Example:

dd if=/dev/sda bs=1b | gzip -cq > my.sda.raw.gz

the tool can handle different files in a struct array, like:

Code:

enum FilesOpenStatusValue {
FileIsClosed = 0,
FileIsOpen,

[code]....

Is there a better way of getting the file name of the redirected file, (respecting the fact that there may not always exist such a thing as a file name for a redirection pipe).
Should i work with inodes instead, and then take a completely different approach when porting to non-unix platforms? Why isn't there a system call like get_filename(stdin); ?

If you have any input on this, or some questions, then please don't hesitate to post in this thread. To add some offtopic to the thread - Here is a performance tip: When doing data shuffling on streams one should avoid just using some arbitrary record length, (like 512 bytes). Use stat() to get the recommended block size in stat.st_blksize and use copy buffers of that size to get optimal throughput in your programs.

View 4 Replies View Related

Ubuntu Servers :: 3.0 Tb Partition Size Limit?

Jun 19, 2010

I really don't understand what's happening.I make a 3.5tb RAID array in Disk Utility, yet it makes it so that one partition is 3tb and the other is 500 gigs free!Why is that? Ext4 can do huge partition sizes I thought.

View 1 Replies View Related

Ubuntu Servers :: Limit To The Size Of POST Variables?

Mar 3, 2011

I have a problem with a PHP/Apache program.

The website creates a RPG character through a traditional Wizard. It calls itself with a hidden variable being the page number and tests which page and returns the page data with the page incremented.

Each page should be treated as a seperate page and so would be unique. I am echoing the contents of POST to the top of the page and so I can see variables being returned. When I get data from an Ajax query from page three it saves the data (23 post fields of no more than 25 characters for each field). Page four does the same but with less fields - but it is NOT returning the data - only four fields being those that were originally posted.

I cut/paste the function from section three to section four and changed the displayed text and the names of variables to test so there are no code errors, since page three works and is saved to a database.

So the only option is that there is a PHP or Apache2 issue when POST variables are returned? I am completely out of ideas as to why this would even be an issue or how it could possibly appear.

Is the number of variables an issue? This page is less than the previous page.... And the form is POSTed...

PS: I am getting NOTICE errors from PHP being the POSTed variables that are not displayed/returned... I used:

error_reporting (E_ALL ^ E_NOTICE);

to stop these form being reported but do I need to test each one? PPS: Using If Isset($_POST['xxx']) does NOT allow that variable through...

PS: I have the default Ubuntu 10.04 Apache2 with all the ubuntu 10.04 updates...

View 3 Replies View Related

Ubuntu Servers :: Log Stdout To File During Boot?

Nov 30, 2010

do you know of a way to redirect stdout during boot time to have a log of the entire process?

I have a remote server which is not booting and I would like to know at which point it gets stucked, what could I do?

View 3 Replies View Related

Ubuntu Servers :: Postifx Mail Receiving Size Limit?

Apr 10, 2010

using kubuntu 9.04 on AMD 64,working with ISPconfig panel.I have postfix configured and have no problem getting mails with small attachments, but when they pass certain size I don't get them.Where can I configure this?

View 3 Replies View Related

Ubuntu :: Limit Directory Size \ Set A Size Limit On?

Mar 2, 2011

I have 2 directories in my home folder that I would like to set a size limit on. The directories are ~/backup and ~/temp. Is there an easy way to limit the size of a directory without having to make partitions?

View 4 Replies View Related

Ubuntu One :: File Size Limit For Upload?

May 11, 2010

I have a large file (deflated size: 602191947)that is not saved in my Ubuntu One account. On sync'ing the file is being uploaded, and eventually reaches 602191947 - and then nothing more happens to this file - but sync'ing the following files in the queue goes on with success. I have tried manual upload with the same result. The file is still being marked as 'uploading' even after several tries and log ins/log outs, and reboots. So I was just wondering whether there is a file size limit - can't seem to find information regarding this.

View 5 Replies View Related

Ubuntu :: Swap File Size Limit?

Oct 20, 2010

a possibly preposterous question. I am aware that you can designate a swap file or swap partition on your hard drive that linux uses as "memory". Suggested sizes for the swap file that I've seen range up to about 1024MB. Is there a limit to the swap file size that you can set?Basically I am running a perl script that processes a massive B) file (DNA sequence data), etc, and requires around 48 GB of memory to run, maybe a bit less. So, would it be possible to set a swap file to a massive, ridiculous size (~60GB oratever) and successfully run such a script on a desktop?Yes, I am aware that it would massively ow down the process. The thing is, if the perl script normally completes in about half an hour, and I can get it working on a desktop, I don't mind if it takes days or weeks to complete. I really don't. That's because it takes days or weeks to get access to a computer with the required grunt to do it.So, is this a stupid idea? Is it even possible? If so, given a perl script that normally completes in a half hour on a 48G system, if you do this, would it take days? weeks? decades

View 7 Replies View Related

Ubuntu :: File Size Limit For Gedit?

Nov 5, 2010

I've noticed that for files longer than about 8000 lines that gedit has problems opening the file. Was gedit not designed for long files or is there another problem? The same thing also happens on complicated html files. So I hope there is a way to fix this.

View 4 Replies View Related

General :: Limit On File Size - Doesn't Allow User To Create File Which Are Greater Than 100Kb

Jun 13, 2011

I was just testing specifying limit on file size to a user and have added the following to /etc/security/limits.conf bob soft fsize 100 This basically should have said not to allow bob to create anyfile greater than 100Kb in size.

But the interesting thing is, if bob already has any file which is greater than 100Kb in size, it even doesn't allow to log him into the system both from console and SSH. Also nothing is logged in logs.. How do I configure it so that, bob can login to the system even though he has any file greater than 100Kb (but doesn't allow him to create file which are greater than 100Kb) ??

View 3 Replies View Related

Ubuntu Multimedia :: Recordmydesktop File Size Limit?

Apr 21, 2010

Does Recordmydesktop have a file size limit? I'm considering using the Zero compression setting to keep CPU usage down, but I don't want to run up against a 2GB or 4GB file size limit. While I know some filesystems impose this limit, most screen recorders I've used have a 2GB or 4GB limit when recording, regardless of the filesystem.Is this an issue with Recordmydesktop

View 1 Replies View Related

Software :: Limit Log File Size With Syslog-ng?

Jan 4, 2010

I have a self-made application running on a small embedded Linux device (which should not matter) using syslog to output some error, warning or debug logs.There is a "better" syslog daemon installed, called syslog-ng, which have some more features,t I miss a very important one:How to limit the size of the logfiles to some dedicated megabytes. I was able to create rotating logfiles with the configuration in syslog-ng.conf:

Code:
destination testlog {
file("/var/log/test/log-$S_WEEKDAY"

[code]...

View 2 Replies View Related

Fedora :: Circumvent Fat32 4Gb File Size Limit?

Dec 16, 2010

I have a single 6.2Gb file that needs to go on a fat32 format hdd, does anyone know of a way to split the file so it will fit.

View 2 Replies View Related

Software :: File Size Limit Exceeded Error?

May 7, 2010

I'm trying to copy a 7.8GB tar.gz file to an external hard drive via command line. It gets to an even 4GB and stops, and gives an error that says "file size limit exceeded." I edited some file at /etc/security/limits.conf to look like: "root hard fsize 10024000" but that didn't do anything at all. Yes, I am copying this as root.

View 9 Replies View Related

Programming :: Soft Limit For Core File Size?

Jun 22, 2011

Using getrlimit I am setting the core file size to be RLIM_INFINITY. But still the core file is not being generated,although in /var/log/messages it says a core is being generated

View 3 Replies View Related

General :: Redirecting STDOUT Of Previous Command To STDIN Of Next Command

Nov 20, 2009

i'm trying to redirect the output of a command to the input of the next command. not sure if i'm going about this the right way. an easy method would be just to store the output of the previous command in a file and redirect input to read that file, but i'm curious to see if this can be done without writing to any files.

View 9 Replies View Related

General :: Apache Access Log File Recommended Size Limit

Jan 17, 2011

Based on some web reference, apache access log file size increased more than 2Gb. It will effect apache performances. Is this correct?

View 4 Replies View Related

Software :: Pdftk 'File Size Limit Exceeded' Error?

Apr 12, 2010

I downloaded pdftk 1.41 fromand installed on Red Hat Enterprise Linux 4, 32 bitI am primarily using this utility to uncompress pdf files to remove the 'Flate' compressionIt works good with small pdfsHowever, when i use to uncompress pdf files of size 35MB or more, the uncompressed output file grows up to 2GB and then the uncompression fails with error:"File size limit exceeded"I can concatenate two files with output file size upto 3GB in size, so 2GB is not the limitation at the linux level

View 1 Replies View Related

Server :: New Open File Size Limit Is Getting Reflected In The Specific User?

May 16, 2011

Last weekend i have increased the open file size (ulimit -n) for the application user id i have update the limits.conf file with necessary inputs restarted the service and the server as well, when i check the ulimit value for the specific user by switching user from other user it shows the new value (10240) but if i login directly using the application id the ulimit value shows as 1024 which one is the default one.

View 6 Replies View Related

Fedora :: Bash - Ulimit: Core File Size - Can't Modify Limit: Operation Not Permitted?

Dec 7, 2009

Fedora 12 gcc 4.4.1 I am doing some programming, and my program gave me a stack dump. However, there is no core file for me to examine.

So I did:
Code:
ulimit -c unlimited
and got this error message:

Code:
bash: ulimit: core file size: cannot modify limit: Operation not permitted I also tried setting ulimit to 50000 and still got the same error. The results of ulimit -a:

Code:
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited

[Code]...

View 3 Replies View Related

Ubuntu Servers :: Maximum Of 1024 File Descriptor Limit?

May 4, 2011

I'm running nginx for static files and as a proxy server for a comet IM server on ubuntu Jaunty. On high load I'm hitting a limit of 1024 file descriptors. I've tried increasing this limit but still can't pass 1024. Does "more /proc/sys/fs/file-nr" gives me the global count of used file descriptors? Why do I see a maximum of 1024 open file descriptors in /proc/sys/fs/file-nr if this is the global count for the machine and each user should have at least 1024 allowed file descriptors by default? Is there a way to increase the limit while the server is running?

Some relevant info on my server:
sudo more /proc/sys/fs/file-nr
1024038001
sudo sysctl fs.file-max
fs.file-max = 38001
sudo nano /etc/security/limits.conf
...
* hard nofile 30000
* soft nofile 30000

I also added this to /usr/local/nginx/conf/nginx.conf:
worker_rlimit_nofile 10240;
Uncommented the following line in /etc/pam.d/su:
session required pam_limits.so

View 1 Replies View Related

Ubuntu Servers :: Redirecting Ports For Running Two Web Servers

Sep 5, 2010

I am running apache2 and tornado web servers on the same server with one ip address.

The apache2 listens on port 80. Tornado listens on port 8888. I want to redirect requests from a specific ip port 80 to port 8888. I don't have the ability to change the port request on the device. It wants is looking for a web server on port 80.

Any other web server request should go to the apache.

I tried adding the following to /etc/ufw/before.rules

When I run iptables -L it doesn't appear. I have disabled and enabled ufw with no help.

View 3 Replies View Related

Software :: Redirect Stdout To File Produces Blank File

Dec 27, 2008

I cannot redirect output from commands such as iptables, iptables-save, and ifconfig. For example, any of the following DOESN'T work ( as root ):

Code:
iptables > tmp
iptables-save > tmp
ifconfig > tmp
The file tmp is ALWAYS blank, that is, 0 bytes in size. Wackier things DO work, such as:

Code:
echo "`iptables-save`" > tmp
iptables-save | tee tmp
Other commands like:

Code:
ls > tmp
DO work as expected.

Note that this problem happens regardless if I log-in remotely via ssh or locally on the computer in question. I am clueless as to what is causing this. Any ideas?The box is running 2.6.25-14.fc9.i686 and boots to runlevel 3. The modifications I've made to the box since installing the OS are things like compiling/installing latest OpenSSH,OpenSSL,httpd,BerkeleyDB,subversion,zlib etc -- nothing really out of the ordinary I'd say.

View 5 Replies View Related

Ubuntu :: Limit The Download Size Of Updates?

Jun 17, 2010

Is there some way to limit the download size of updates for ubuntu? At the moment, update manager shows that I have some 300 MB worth of downloads. I can't find any way to deselect many updates at once either.

View 3 Replies View Related

Ubuntu :: Mount & Limit Folders Size?

Oct 24, 2010

I have a 1TB external hard drive. I would like to create in it 10 folders:

Code:

I would then like to permanently mount each folder to its machine (I have 10 machines connected through a switch, so each machine will have a folder that is mounted to ONE of the 10 folders in the external hard drive).

My questions:
(1) Is this a good configuration? are there better ideas to give individual machines more space without replacing their hard drive?
(2) How do I limit each one of the folders ('folder1', 'folder2', ...., 'folder10') to a size of 100 [GB]? I don't want one folder (say, 'folder1') to grow in size and 'steal' the space designated to the other folders.

View 2 Replies View Related

Ubuntu Servers :: Apt - Get File Size Mismatch Due To SQUID?

Sep 9, 2010

I am trying to get apt-get to work on a server thats behind a squid proxy server.I have added exections in squid.conf to allow all on [URL]..apt-get can find updates but when it try's to download/install I get

Code:
Failed to fetch http://gb.archive.ubuntu.com/ubuntu/pool/main/g/gdebi/gdebi_0.6.0ubuntu2_all.deb Size mismatch
if I
Code:
wget http://gb.archive.ubuntu.com/ubuntu/pool/main/g/gdebi/gdebi_0.6.0ubuntu2_all.deb
it works..

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved