Ubuntu :: Proper Way To Use Temp File And Or /tmp In Bash Script?

Apr 25, 2011

I'm wondering if there is a proper way (or just best practice) to using temp files and the /tmp directory. Background story: In a script I had been using mktemp to create temp files in /tmp. Needless to say that after running this script for a while, it filled /tmp and my HDD with these files. I didn't realize that i needed to do house cleaning of /tmp.

So now I'm curious as to how to properly use temp files and how to not abuse /tmp. I suppose some of my shortcomings arise from the fact that I somehow had the crazy idea that /tmp was policed by the system and cleaned out when necessary. I assume that I'll just need to self police and use my temp files more intelligently and get rid of them when I'm done with them instead of letting them clutter up /tmp.

View 3 Replies


ADVERTISEMENT

Ubuntu :: Possible? /temp/www/fake/ Contents (directory) Avaliable Through /temp/www/?

Dec 20, 2010

I have a web server whos DocumentRoot is:/tmp/wwwNow, /temp/www/fake/ is a directory that contains a series of other files/folders.What I want to do is access the files in /temp/www/fake as if they were in the root directory (/temp/www/)For example:

could either be located in "/temp/www/test.php"
-or-
located in "/temp/www/fake/test.php"

so "http://127.0.0.1/test.php" would essentially call both directories. Is this possible? Whould I do this through apache or through the actual file system somehow? (Like some sort of symbolic link?) I would love to hear your input.

View 8 Replies View Related

Software :: Cannot Open Temp File: Iozone.tmp

Mar 7, 2011

While running file system benchmarking test for my nand by issuing following command...

./iozone -aon 1M -g 100M -y 512 -IRb nand.xls &

I found the following Can not open temp file: iozone.tmp

what is wrong with this? I dont think it has something to do with permission issues...

View 1 Replies View Related

General :: How To Find Size Of Flash File Not Stored In Temp

Apr 8, 2011

How to find the filesize of a flash which is not exactly stored in the temp but redirected by a fd.
flash31 -> /tmp/FlashXXvsg1uY (deleted) directory is /proc/processid
Chrome is downloading a flash and I can see in the proc directory the flash file, How can I see the current file size of such a file ?

View 1 Replies View Related

Networking :: Programs Cannot Create Temp Files On Nfs-mounted NTFS File System?

Jun 14, 2010

I have an NTFS file system nfs-automounted on our RedHat servers. Users can read and write to the file system no problem, and can create new files, edit them, and delete them to their heart's content. The only issue is that utilities such as "dos2unix" cannot create temporary working files:

$ dos2unix events.0818.dat
dos2unix: converting file events.0818.dat to UNIX format ...
Failed to open output temp file: Operation not permitted
dos2unix: problems converting file events.0818.dat

This isn't limited to "dos2unix"; any other utility that creates a temporary working file gets the same problem. If I copy the file to a local file system like /tmp, it works fine. Here's the kicker: this works fine on Solaris systems. I can take the "dos2unix" utility over to a Solaris system that has that exact same NTFS file system automounted via NFS, and it works. No issues creating temporary working files at all.

View 5 Replies View Related

Ubuntu Networking :: Put Proper Information Into Fstab File?

Feb 24, 2011

I have a working network Ubuntu 10 Win7 (thanks to you guys on this site).

My last hurdle is how to mount folders or disks from Win7 onto Ubuntu.

I used a tutorial, and got fstab installed I think...

Where do I get the information to PUT IN fstab and WHERE to put it?

Here is my fstab file code...

View 2 Replies View Related

General :: Proper Way To Organize File Server ?

Mar 7, 2011

I am setting up a file server using Ubuntu and want to make sure I set up a folder structure that will last. Where should I be placing everything that I am sharing (Music, Pictures, Videos, etc)? In theory, if I was setting this up on Windows, I would create a folder directly under C: and set up the different areas of sharing under that (not that that approach would be best either).

Based on constructive criticism, the question is rather ambiguous. My question could be restated to ask "Where shouldn't I set this up? Would /usr be an appropriate place to start? Or would /opt be better?

View 2 Replies View Related

General :: Can't Write File Despite Proper Permissions

Mar 29, 2010

Under debian i did this:

casey@t400:~/programs$ ls -l
-rw-rw-r-- 1 root root 2071 2010-03-28 05:15 urlgetter.cpp

Then

casey@t400:~/programs$ gedit urlgetter.cpp

and upon attempting to save the file, I get the error

"Could not save[...] You do not have the permissions necessary to save the file."

but I am a member of the group root:

casey@t400:~/programs$ cat /etc/group | grep root
root:x:0:casey

View 2 Replies View Related

General :: Grasp The Proper Way To Modify The Sudoers File

Jun 3, 2010

Relatively new to Linux, but I'm trying to grasp the proper way to modify the sudoers file. As an example, what would I have to modify in /etc/sudoers to allow a user (say 'user1' for the example) to be able to add/remove software through yum? I'm aware of the fact that I need to use visudo and how to use the vi editor. I've Googled this topic and while I've found a number of pages on the topic, I never see many examples.

View 5 Replies View Related

General :: Unable To Create File With Proper Privileges

Jul 21, 2010

Code:RW-00022: Error: - Unable to create file with proper privileges: JAVA_TOP Mount Point = /media/SAMSUNG/d01/oracle/vis/apps/apps_st/comn/java/classes test using command: su applmgr -c "touch /media/SAMSUNG/d01/oracle/vis/apps/tech_st/10.1.3/appsutil/jdk/test.tst"
touch: cannot touch `/media/SAMSUNG/d01/oracle/vis/apps/tech_st/10.1.3/appsutil/jdk/test.tst': Permission denied

I am trying to install Oracle ebs on my machine and I keep getting the above error.

View 13 Replies View Related

General :: Output A Text File In Proper Format?

Mar 4, 2010

it compares two files using md5... if they are same , a corresponding character is output to a text file .. but the problem is it gets appended by default.. is there any way to output in a normal way because the text is a message and it should be of proper format
here is my script

Code:

#!/bin/bash
g=`tail -1 new.txt|head -n 1`
array=( a b c d e f g h i j k l m n o p q r s t u v w x y z )
for((i=1 ; i <$g+1 ; i++))

[code]....

the message is supposed to be hello , i need to get rid of the endlines somehow..

View 2 Replies View Related

General :: Whenever Execute The Below Scriptlet With Out Proper File Name It Deletes /tmp Directory?

Jul 22, 2010

Whenever execute the below scriptlet with out proper file name it deletes /tmp directory .I guess this is because value of variable a didnt get initialized and there for rm -rf /tmp/ get executed and entire /tmp directory get deleted.How would i avoid any empty variables to be used in script? as this is a classic case of destructive script.

Code:
#!/bin/bash
echo "Enter file to delete from tmp"

[code]....

View 8 Replies View Related

General :: Write A Literal Bash Command In A Bash File?

Nov 29, 2010

I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:

Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END

[code]...

View 6 Replies View Related

Ubuntu :: Help With Bin File - Error Message - Bash - /hldsupdatetool.bin - No Such File Or Directory

Jun 9, 2009

I am new to Linux and I wanted to setup a dedicated game server on my notebook.

I've installed Ubuntu 9.04. I than created a directory named /home/phlex/kfserver. I downloaded the application binary from Steam. I changed the file permission with chmod +x hldsupdatetool.bin and now the file attributes are -rwxr-xr-x.

The problem is when I try to run the binary file. If I type ./hldsupdatetool.bin I get an error message "-bash: ./hldsupdatetool.bin: No such file or directory. It seems the OS can't find the file. I've downloaded the file several times thinking it may have been corrupt but it's not. I can delete the file, I can rename it and so the file is there. Sometimes Linux can be aggravating to use.

View 7 Replies View Related

Programming :: Bash File Comparing - Report How Many Matching Words My Main File ?

Jun 9, 2009

I have been messing with diff and grep for 2 days now without result

I am trying to match a file consisting of words to many separate other wordfiles in a specific directory. one by one.

What i want the script to do is to report how many matching words my main file has with every file in the directory, each in turn

setup:

Each of em are plain text files with 1 word per line

Output should be something like:

SCRIPT REPORT:

View 8 Replies View Related

General :: Printing From Bash Shell / Concatenate Files Into One File With File Names Included?

May 11, 2011

I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.

Should I be looking to concatenate the files into one file with the file names included, and then print them?

something like: -printfunction -printername < file*

View 7 Replies View Related

Programming :: Bash File Which Requests File Name

Nov 30, 2010

What's the easiest way for me to make a program that requests a file location and then tar balls it. I basically want to start making a simple method of using pv with tar (lzma).

View 8 Replies View Related

Ubuntu :: How To Enable Cpu Temp

May 9, 2010

i have added the hardware sensors monitor to the panel and enabled....but i can only enabled my hardisk temp(i.e. hddtemp)...but there is no option of cpu.....how can i enable my cpu temp??

View 5 Replies View Related

Ubuntu :: How To Monitor Temp Of CPU?

Sep 26, 2010

How can i monitor the temp of my CPU? Using Ubuntu 10.10 & Gnome desktop.

View 1 Replies View Related

Ubuntu :: Tmp Or Temp Assigned Elsewhere?

Oct 1, 2010

is it possible to have the tmp or temp folders assigned elsewhere. I am actually looking to stick them in the shm folder since there is enough memory to throw around the place ..

View 1 Replies View Related

Ubuntu :: Adding Cpu Temp To Top Menu Bar?

Jan 16, 2010

i've recently been required to monitor my cpu's temp. for one, i have no idea how to do so, and for another i'd like to do so by continually seeing the temperature displayed on the top menu bar, similarly to how you can setup graphs displaying your cpu use, memory, etc.

View 9 Replies View Related

Ubuntu :: Where To Change C To F So It Reads USA Temp

Jul 9, 2010

I'm having little problem trying to change weather to USA it reads C instead of F on conky forecast here is screenshot.

View 7 Replies View Related

Ubuntu :: Why Does CPU Temp Fluctuate So Frequently

Jan 27, 2011

I'm looking at conky and my cpu frequency is fluctuating really fast (in a relatively narrow range) but from second to second I can see a 2-3 degree change, is this even possible? It seems like the sensors aren't working right if they are showing changes that fast.

View 2 Replies View Related

Ubuntu :: /bin/bash: : No Such File Or Directory

Jan 20, 2011

I had netbeans installed and I removed it using wheris netbeans and then sudo rm whatever files it gave.I also remember doing sudo rm -r /usr/lib/netbeans6.9 I did this because i wanted to install netbeans via the repo. Now I installed netbeans suing

Code:

varun@varun:~$ sudo apt-get install netbeans

and when I try running netbeans i get...

Code:

varun@varun:~$ netbeans
/bin/bash: : No such file or directory

Have i changed permissions or something?

View 1 Replies View Related

Ubuntu :: How To Change FireFox's Temp Folder

Mar 8, 2010

I have no idea where the firefox temp files are being downloaded to, but I would like to change the directory to a folder in my home directory.

View 4 Replies View Related

Ubuntu :: Read Host CPU Temp From Guest OS?

May 16, 2010

Is it possible to read the host cpu's temperature from a virtual guest?

(1) Where host = ubuntu desktop and guest = ubuntu server, and

(2) Where host = windows xp and guest = ubuntu server?

Typically I would read the contents of /proc/acpi/thermal_zone/THRM/temperature on host ubuntu desktop. I guess its more tricky when running ubuntu on windows host. What I am trying to do is shutdown guest if host cpu temperature is greater than certain value.

View 2 Replies View Related

Ubuntu :: How To Measure Temp In UNE 10.04 Since Panel Locked

Jun 14, 2010

Any good ideas for a GUI program that monitors temp for CPU and hard drive? I'd prefer one that is like a system monitor that can show trends on a graph (like CPU usage, etc). It is irritating that you can't even add a silly app to the panel because UNE is locked (ERR, Ubuntu, what were you thinking? Give US the choice! Rant over) So far, I have just written a quick script after installing lm-sensors and hddtemp and run the necessary setup routines that will show me, but I would like some of the history data.

Code:
#! /bin/bash
# zenity --info --title "Temp INFO" --text "sensors"

View 2 Replies View Related

Ubuntu Installation :: Splash Screen Temp Fix?

Jun 25, 2010

The new splash screen would fly by in two shakes without, the dots moving left to right.And I was looking at more blackness than purple. So what I did was this without installing a slower uvesa v86d update. I used that as a reference point instead. This is what me Grub2 looks like: /etc/default/grub

Code:
GRUB_DEFAULT=2
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

[Code]...

View 4 Replies View Related

Ubuntu :: Where Are The Temp Video Files Stored

Aug 1, 2010

In Karmic, where is the temporary file stored of a video like ..... after it is played?

View 1 Replies View Related

Software :: Ubuntu 9.10 - Temp Reaches Around 80 To 90 Degrees

Nov 1, 2010

I am using ubuntu karmic kola 9.10. The problem I have been having lately is of overheating of my intel core2duo proc, where the temp reaches around 80-90 degrees and the cpu shuts down after a while and the message from the bios is of thermal trip. Ideally my cpus temp is around 55 deg,the moment when the temp starts to climb and when I run a top command, I see arpwatch taking 100 % of cpu. After googling I came across this.

Code:
[URL]. How can a process which is taking 100 % cpu cause a system to over heat and shutdown in few mins? I have had seen instances where processes taking a lot of cpu but not something like this.

ryan@wsx04:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"

Code:
ryan@wsx04:~$ dpkg -s arpwatch
Package: arpwatch
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 468
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Architecture: amd64
Version: 2.1a13-2.1

Code:
ryan@wsx04:~$ sa | grep -i arpwatch
4 292.10re 2.06cp 0avio 5176k arpwatch*

View 2 Replies View Related







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