07-05-2010
Have a good look at what you might be deleting in the context of your own system and its software. There is no general answer to this except as Scrutinizer suggests doing it during a reboot. Certainly confine any deletions to files (i.e. not pipes, directories etc.) and perhaps look at files which are older than your most recent boot to start with. If you have a database engine running be aware of how long it has been up an what files it creates.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
does anyone have a script that can check the contents of the /tmp directory and for example e-mail the directory content if anything other than session files are present?
Maybe there are better ways to monitor suspicous /tmp and /var/tmp activity, if so I'm listening :) (1 Reply)
Discussion started by: jamesbond
1 Replies
2. Solaris
I have a Solris 9 box my problem is when I restart my box all my files and dirs in /tmp dir will be deleted exept 2 directories I found them since installation phase !!!!
How to keep my files at that dir " /tmp " even after restarting ??? (1 Reply)
Discussion started by: DarkSoul
1 Replies
3. Shell Programming and Scripting
Hi,
In a directory, say
~/dir
is a lot of files and subdirectories. Some of the files are named
res1.om
res2.om
...
res65.om
The amount of files varies. I need a .csh script that deletes all res*.om files except the one with the highest number.
Any suggestions?
Thanks in... (6 Replies)
Discussion started by: pederlol
6 Replies
4. Linux
Hi All,
Can I delete the above file? It's big, about 1G. It's on a redhat ent 4 with ldap on it.
Is that safe to delete? It wasn't been used for already a month and it's in the backup storage.
Thanks for any comment you may add. (1 Reply)
Discussion started by: itik
1 Replies
5. Shell Programming and Scripting
Hi All ,
I want to delete files from /tmp directory created by "xxxx" id.
because i got the list says more than 60 thousand files were created by "xxxx" id since 2002.
The /tmp directory has lot of files created by different user ids like root,system etc..
But, i need a script to... (2 Replies)
Discussion started by: vparunkumar
2 Replies
6. Shell Programming and Scripting
Hello,
I just saw that on my vps (centOS) my oscommerce with a seo script
has created millions of tmp files inside the /html/cache/ directory.
I would need to remove all those files (millions), I tried via shell but the vps
loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies
7. Shell Programming and Scripting
I am trying to FTP files to a Windows server through my Linux machine. I have setup the file transfer with no problems but am having problem deleting those files from the Linux box. My current non-working solution is below. Any ideas, anyone?? :wall: Please be gentle, I'm fairly new to this... (4 Replies)
Discussion started by: jmalfhs
4 Replies
8. AIX
This is AIX box and I am not able to create or delete file in /tmp though space is there
root@ttcols01/ #touch /tmp/test_file
touch: 0652-046 Cannot create /tmp/test_file.
root@ttcols01/ #mkdir /tmp/test_dir
mkdir: 0653-358 Cannot create /tmp/test_dir.
/tmp/test_dir: Invalid file system... (9 Replies)
Discussion started by: solaris_1977
9 Replies
9. Shell Programming and Scripting
Hi
My directory structure is as below.
dir1, dir2, dir3
I have the list of files to be deleted in the below path as below.
/staging/retain_for_2years/Cleanup/log $ ls -lrt
total 0
drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2
drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies
10. Shell Programming and Scripting
Hi,
i need help on shell scripting.
Main intention of the script is
step 1: ssh to remote server
Step 2: cd /tmp in remote server
Step 3: in tmp i want to grep only files and directories which are in GB sizes
All the servers list file is - tmpsrv.txt
vi tmpsrv.txt
... (17 Replies)
Discussion started by: kumar85shiv
17 Replies
LEARN ABOUT CENTOS
fixfiles
fixfiles(8) fixfiles(8)
NAME
fixfiles - fix file SELinux security contexts.
SYNOPSIS
fixfiles [-v] [-F] [-B] [ -N time ] [-l logfile ] { check | restore|[-f] relabel | verify } [[dir/file] ... ]
fixfiles [-v] [-F] [ -R rpmpackagename[,rpmpackagename...] ] [-l logfile ] { check | restore | verify }
fixfiles [-v] [-F] -C PREVIOUS_FILECONTEXT [-l logfile ] { check | restore | verify }
fixfiles [-F] [-B] onboot
DESCRIPTION
This manual page describes the fixfiles script.
This script is primarily used to correct the security context database (extended attributes) on filesystems.
It can also be run at any time to relabel when adding support for new policy, or just check whether the file contexts are all as you
expect. By default it will relabel all mounted ext2, ext3, xfs and jfs file systems as long as they do not have a security context mount
option. You can use the -R flag to use rpmpackages as an alternative. The file /etc/selinux/fixfiles_exclude_dirs can contain a list of
directories excluded from relabeling.
fixfiles onboot will setup the machine to relabel on the next reboot.
OPTIONS
-B If specified with onboot, this fixfiles will record the current date in the /.autorelabel file, so that it can be used later to
speed up labeling. If used with restore, the restore will only affect files that were modified today.
-l logfile
Save the output to the specified logfile
-F Force reset of context to match file_context for customizable files
-f Clear /tmp directory with out prompt for removal.
-R rpmpackagename[,rpmpackagename...]
Use the rpm database to discover all files within the specified packages and restore the file contexts. (-a will get all files in
the RPM database).
-C PREVIOUS_FILECONTEXT
Run a diff on the PREVIOUS_FILECONTEXT file to the currently installed one, and restore the context of all affected files.
-N time
Only act on files created after the specified date. Date must be specified in "YYYY-MM-DD HH:MM" format. Date field will be passed
to find --newermt command.
-v Modify verbosity from progress to verbose. (Run restorecon with -v instead of -p)
ARGUMENTS
One of:
check print any incorrect file context labels, showing old and new context, but do not change them.
restore
change any incorrect file context labels.
relabel
Prompt for removal of contents of /tmp directory and then change any incorrect file context labels to match the install file_con-
texts file.
verify List out files with incorrect file context labels, but do not change them.
[[dir/file] ... ]
List of files or directories trees that you wish to check file context on.
AUTHOR
This man page was written by Richard Hally <rhally@mindspring.com>. The script was written by Dan Walsh <dwalsh@redhat.com>
SEE ALSO
setfiles(8),restorecon(8)
2002031409 fixfiles(8)