Sponsored Content
Top Forums Shell Programming and Scripting Script for delete tmp files older than 15 days and owned by "xxx" id Post 302370781 by Tytalus on Thursday 12th of November 2009 11:27:24 AM
Old 11-12-2009
use find...

would suggest you get a list, then loop over it and delete files - then you have a record. e.g.

Code:
# cd /tmp
# find . -user xxx -mtime +15 > filelist

#  while read f; do rm $f; done <filelist

HTH
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl CGI to access / edit "root" owned config files

I am trying to write a CGI program which accesses UNIX configuration files and changes them as required. The thing is, I don't want the CGI program to be "root" owned - it's Perl based! Is there any way that the Perl CGI program can request a username and password - and then use this to... (1 Reply)
Discussion started by: WIntellect
1 Replies

2. Shell Programming and Scripting

Delete files older than 2 days using shell script in Unix

I'm new to shell script.... can any one help... What is the shell script to delete the files older than 2 days ? (3 Replies)
Discussion started by: satishpabba
3 Replies

3. AIX

xx=`date +"%a %b %d"`;rsh xxx grep "^$XX" zzz ?

AIX 4.2 I am trying to do an rsh grep to search for date records inside server logs by doing this : xx=`date +"%a %b %d"` rsh xxx grep "^$XX" zzz gives : grep: 0652-033 Cannot open Jun. grep: 0652-033 Cannot open 11. But if I do : xx=`date +"%a %b %d"` grep "^$XX" zzz it works... (2 Replies)
Discussion started by: Browser_ice
2 Replies

4. Shell Programming and Scripting

Delete files older than "x" if directory size is greater than "y"

I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y" #!/bin/bash du -hs $1 while read SIZE ENTRY do if ; then find $1 -mtime +$2 -exec rm -f {} \; echo "Files older than $2 days deleted" else echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 Replies

5. Shell Programming and Scripting

Compiling multiple ".c" files starting with xxx

Hello, I am trying to figure out how I can write a bashscript that compiles several ".c" files that start with xxx (example: xxx_try.c and xxx_that.c) So I want to compile all these files with a bash script. Anyone can help pls? (6 Replies)
Discussion started by: Freak79
6 Replies

6. AIX

echo $varibla | mail -s "subject" "xxx@xxx.com" not ruuning as expected

Hi Folks, As per the subject, the following command is not working as expected. echo $variable | mail -s "subject" "xxx@xxx.com" Could anyone figure it out whats wrong with this. I am using AIX box. Regards, (2 Replies)
Discussion started by: gjarms
2 Replies

7. Solaris

The slices "usr", "opt", "tmp" disappeared!!! Help please.

The system don't boot. on the screen appears following: press enter to maintenance (or type CTRL-D to continue)...I checked with format command. ... the slices "0-root","1-swap","2-backup" exist. ...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies

8. Shell Programming and Scripting

Script to delete files in a folder older than 2 days

hi i need a script to delete the files older than 2 days... if my input is say in a folder versions A_14122012.txt A_15122012.txt A_16122012.txt A_17122012.txt i want my output to be A_16122012.txt A_17122012.txt thanks in advance hemanth saikumar. (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

9. Shell Programming and Scripting

Script to delete files older than x days and also taking an input for multiple paths

Hi , I am a newbie!!! I want to develop a script for deleting files older than x days from multiple paths. Now I could reach upto this piece of code which deletes files older than x days from a particular path. How do I enhance it to have an input from a .txt file or a .dat file? For eg:... (12 Replies)
Discussion started by: jhilmil
12 Replies

10. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
DEBDELTAS(1)							   User Commands						      DEBDELTAS(1)

NAME
debdeltas - compute deltas between Debian packages SYNOPSIS
debdeltas [OPTION]... ARGS ... DESCRIPTION
debdeltas computes deltas between the old and new versions of Debian packages. The explanation of what a delta is is in debdelta(1). COMMAND ARGUMENTS
In all of the following, ARGS can be, a Debian binary file (usually, a file ending in .deb), or a directory containing such files, or a Packages file (that is, an index file such as those found in Debian mirrors - even the zipped ones - see apt-ftparchive(1) ). We will call cmdline all such args that are not related to an option. As a first step, debdeltas builds an internal list of Debian packages. To this end, it parses all ARGS of the options --alt , --old , and those ARGS given as non-option arguments (the aforementioned cmdline args). If the argument is a Debian package, debdeltas adds it to the list; if the argument is a directory, debdeltas scans it for Debian packages to be added to the list; if the argument is Packages files, debdeltas parses it and adds all Debian packages to the list. Then debdeltas groups all found Debian packages by name and architecture. For each group, the newest cmdline version is isolated, and then deltas are computed from all --old versions to that version. These deltas are stored in many delta files with appropriate names of the form name_oldversion_newversion_architecture.debdelta ; the loca- tion of the delta files is specified by the "--dir" option. Note that the location of files in a Packages index is specified relative to the base of the mirror, e.g. Filename: pool/main/x/xxx/xxx_3_i386.deb For this reason, any Packages argument must presented with a long path (that contains at least the dists directory). Note also that the same directory or index can be provided many times, as --old, as --alt, and as cmdline argument. Note also that debdeltas will skip all packages that are smaller than 10KB. MAIN OPTIONS
--dir DIR force saving of deltas in this DIR (otherwise they go in the dir of the newer deb_file). --alt ARGS this is parsed as the non-option command line, but the found packages are never considered for a delta. They are considered though when --clean-deltas is used, to decide if to delete a delta; and are useful to find debs that are deleted from indexes and moved elsewhere. Multiple --alt can be specified. --old ARGS this is parsed as the non-option command line, and the found packages are considered as the older versions. Multiple --old can be specified. Moreover, when scanning a Packages index, it is not an error if files do not exist, as long as they have been moved in a --alt directory. Note that, if no --old is specified, then no deltas will be generated. --forensicdir DIR write hashes files; these are to be compared with those produced by debdelta-upgrade --forensic=... when a delta fails The double slash If a directory path is provided as argument to --dir, and it ends in // , then this triggers a specific behaviour related to files found in Packages indexes (as presented in the commandline). If a package in a index is stored in pool/main/x/xxx/xxx_3_i386.deb , and --dir is /tmp/foobar// , then the delta will be saved in /tmp/foobar/pool/main/x/xxx/xxx_2_3_i386.debdelta. The same is true for --alt (and is use- ful to find old versions of a package). OTHER OPTIONS
--signing-key KEY key used to sign the deltas (using GnuPG) -n N how many deltas to produce at maximum for each unique package/arch (default unlimited) --clean-deltas delete deltas that upgrade to packages versions that are not found in the cmdline ARGS, and are at least two days old (according to mtime). --no-md5 do not include MD5 info in debdelta. --needsold create a patch that can only be used if the old .deb is available. --delta-algo ALGO use a specific backend for computing binary diffs; possible values are: xdelta xdelta-bzip xdelta3 bsdiff -M Mb maximum memory to use (for 'bsdiff' or 'xdelta'). --test check that the patch does apply. -v verbose (can be added multiple times). -d print traceback on errors; save useful info in temporary files in case that a backend crashes. (If '-d' is added multiple times, it also adds to the patches other extra debugging checks: only for advanced bug tracking). -k keep temporary files (use for debugging). --gpg-home specify a different home for GnuPG, default for root is /etc/debdelta/gnupg while for other users is unset. See --homedir in gpg(1) for details. --disable-feature FEATURE disable an internal feature. See the documentation in README.features. --no-act Just list the deltas that would be created. SECURITY
See debdelta(1) EXIT STATUS
See debdelta(1) EXAMPLES
debdeltas --dir /tmp/ --old ~/mydebs ~/mydebs will generate all deltas to upgrade from the old versions in ~/mydebs to the newest version in ~/mydebs , and store the deltas in /tmp/ debdeltas --dir /tmp// --old /mirror/debian/dists/lenny/main/binary-i386/Packages.gz /mirror/debian/dists/squeeze/main/binary-i386/Pack- ages.gz will generate all deltas to upgrade main/i386 from lenny to squeeze, and store the deltas in a pool structure under /tmp/ See also the example scripts /usr/share/debdelta/debmirror-delta-security and /usr/share/debdelta/debmirror-deltas REPORTING BUGS
Report bugs to <mennucc1@debian.org>. AUTHORS
Debdelta was written and is copyright (C) 2006-09 Andrea Mennucci. This man page was written by Jegou Pierre-yves <pierreyves.jeg@voila.fr>. COPYING
This is free software. You may redistribute copies of it under the terms of the GNU Library General Public License <http://www.gnu.org/licenses/lgpl-2.0.html>. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
debpatch(1), debdelta(1), /usr/share/doc/debdelta/README. debdeltas aug 2009 DEBDELTAS(1)
All times are GMT -4. The time now is 01:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy