General :: Script To Delete Logfiles Older Than 1 Day?
Jul 6, 2011I use this below script to delete the logfiles older than 1 day .find /home/cie101/madhu1 -mtime +1 -exec rm {} ;and it doesnot work properly.
View 12 RepliesI use this below script to delete the logfiles older than 1 day .find /home/cie101/madhu1 -mtime +1 -exec rm {} ;and it doesnot work properly.
View 12 RepliesPossible Duplicate:How do I delete files greater than a certain date on linux How to delete all files in current directory and it`s sub directories older than one year ?
View 2 Replies View RelatedI am trying to put together ksh shell and I am new with writing scripts.How do you write a command to delete any files if it's 30 days old and also it's not currently being locked?
View 10 Replies View Relatedfind -type f /path/* -mtime +7 -exec rm {} ;Is this the best way to delete only files (not directories) within /path that are older than 7 days? or is there a better way?
View 3 Replies View RelatedI have been trying to write a script that will take a directory, for example /accounts compress it into a .tar file with the filename containing the date of compression, for example accounts030210.tar and then place that file into a directory called /archive
I also want the script to delete files in /archive that are older than 7 days.
I am having my own testing server in which mySQL database will be backed up daily. in the format mysql_backup_dd/mm/yy.tar.gz in my home folder I need to setup a cron job to delete the backups older than 7 days.how to do this.
View 3 Replies View RelatedWhen creating sub-domains, and creating log files for each domain, do I need to ensure that apache owns the log files, so that it can write to it? As I notice they are owned by root, obviously whom I used to make the file...
View 2 Replies View Relatedhow can I rotate logfiles multiple times a day? I notice that the configuration for the logrotate-command is hourly, daily, weekly,.I notice that I can create a cron job where I specify the different times the log rotation need to be done:15 0,8,12,17 * * *But how do I combine these two ?
View 7 Replies View RelatedI am new to unix, I am looking for a script to delete files older than 7 days but i also want to exclude certain directories (like arch,log .....) and also some files with extensions ike .ksh, .ch, ..............) in directories and sub directories
View 4 Replies View RelatedI've been trying to delete all files older than 7 days in a directory temp1.I have try different ways but nothing happend:
find /temp1/* -mtime +7 -exec rm rf
find . -mtime +7 -exec rm rf
find /temp1/* -mtime +7 -print -exec rm{}
When I turn on my computer, because of frequent updates it will display several versions of Ubuntu 10.10 that I can choose from. I wonder if it is possible to delete some of the older versions and how. I think having several versions of Ubuntu uses up a lot of space in the hard drive.
View 4 Replies View RelatedI got this part from my script working that it will delete a folder is from 8 days agoEightDaysAgo=`(date --date="8 days ago" +%d-%m-%Y)`rm -rf $EightDaysAgoTarHowever I need to remove files that are older than 8days for example if the script is'nt run for a day it will remove both the 9th and 8th day one not just the 8th day one. If I'm making any sense lol
View 3 Replies View RelatedI have server running ubuntu. There is folder /var/netflow and I have there files, which creates every 5minutes new ones(monitoring traffic on network). And I need to delete files older than 6 months manually. Can you help?
View 2 Replies View RelatedCan I delete files in trash that is older than 10 days with a terminal command?
View 3 Replies View RelatedI have set up a simple find and delete script for files older than X days. The problem is that some of the files that are send in this share are transfered from an archive server and creation/modified date remains the same when copied and the age of them could be a year ago or older and they get deleted over night by the script.For performance reasons the raid is mounted with noatime in fstab.Do you see any solution to this problem except enabling atime?I'm thinking at some more advanced script that writes the list of added files once a day and marks them for deletion after some time.
View 2 Replies View RelatedI wish to prevent the samba messages (mainly nmbd and winbindd) from appearing in the system log (/var/log/messages). I want to allow samba logging to the standard samba logfiles, but prevent the syslog getting clogged up by samba. I added syslog = 0 to smb.conf and reloaded the config but the messages were still appearing. I also tried the following (and restarted the syslog via /sbin/service syslog restart) # Suppress messages from samba.
nmbd.* /dev/null
smbd.* /dev/null
winbindd.* /dev/null
For interests sake the messages I'm getting are below (I'm not concerned about the messages themselves, I can chase them up at my leisure via the samba logs) Mar 18 09:58:29 SERVER nmbd[3808]: query_name_response: Multiple (2) responses received for a query on subnet xx.yy.z.zz for name DOMAIN<1d>. Mar 18 09:58:29 SERVER nmbd[3808]: This response was from IP xx.yy.z.zz, reporting an IP address of xx.yy.z.zz.
I need to find out why one server doesn't accept mail from my server. Mail isn't delivered and isn't bounced.Usualy it's easy to find in mail log files, but not in my new server. I just checked mail log files and discovered there is no information for each email sent from my server.
All log files:
mail.log
mail.err
mail.info
mail.warn
Is there a way to install older version of gcc using yum?I do a yum search, but it shows only the latest 4.5 version.
View 8 Replies View RelatedI have read the sticky and taken the quizzes, even installed ubuntu, mint, and fedora. I am looking for a distro for an older (4+) years E-machine PC. All I really want it to do is play Netflix online, and movies I have stored to an external hard drive. Maybe some torrenting and VERY light document work. I want it to be fast, and stable. Not bloated with all kinds of stuff I don't need like Ubuntu and mint, or crash like fedora every 20 mins.
View 7 Replies View RelatedI have an older computer that doesn't support booting from USB. Is there a boot CD that will boot an OS from USB such as the way Etherboot does for computers that don't support PXE?
View 1 Replies View RelatedNo matter which glibc I use, I get the error that I need a compiler that supports visibility. I'm using 4.4.5, so it can't be too old.What is the visibility for gnu, this is a compile for glibc.Any glibc fails for the same reason. I can't compile an older version of gcc, more errors. Is it possible to turn off the check for visibility?
View 1 Replies View RelatedI used following command to sort one day older log files
Quote:
find /opt/TimesTen/tt_transaction_log/ -name "mtsDB.log*" -mtime +1 -print
following are log files which are existing, I have to delete one day older files from this location but when use above mentioned command it won't print one day older files, as i understand "-mtime" modified time, "+1" means one day older. am i correct?
Code:
-rw-rw-rw- 1 ablddb dba 268435456 May 30 17:11 mtsDB.log126985
-rw-rw-rw- 1 ablddb dba 268435456 May 30 17:17 mtsDB.log126986
-rw-rw-rw- 1 ablddb dba 268435456 May 30 17:23 mtsDB.log126987
[code].....
How can i print one day older logfiles?
my ubuntu version has changed from v.2.6.27-7 to 2.6.35.-- while i was trying to install my lxu800 modem.my modem was not intalled. this upgradation took place when i installed linux-image-2.6.27-7.deb files. now i want to get my older version of ubuntu. how can i do it.
View 3 Replies View RelatedI am using Suse linux 10 currently I have gcc 4.1.2.. I want to install gcc 3.4.2 .
View 3 Replies View RelatedI had upgraded from Samba to Samba 3x awhile ago. Which I found out that I didn't need to do because I have to update now 9 large patch releases which I have to install in order. Starting with the first one and I'm having Samba dependencies problems now. The patch releases to install are older than what's currently installed. Hopefully, once I get the conflicts resolved the rest should fall in line.
View 4 Replies View RelatedDo you know where I can get ISO's of older versions of debian. ver 2.2 ver 3 and 4
View 2 Replies View RelatedI did apt-get install qtcreator and it installed qt 4.5.3(qt4.5.2real) I had qt 4.5.2. If I go in Applications->programming I see 2 shortcuts for qtcreator, one of them being newer. How do I remove the older one? On another note, if I want to update Qt to 4.6 what would be the steps if I already have qt 4.5
View 1 Replies View RelatedI'm sure the answer is yes but, I'm wondering if you could put a newer distro of Linux on an older Mac (for example an iMac G4 or G5).
View 4 Replies View Relatedon my site now I'm using cache and need me cron script that will delete files older than 1 hour I have feature in my kloxo control panel just need me the command .
View 2 Replies View RelatedI am getting this when I build a project in JBoss Seam:
Code:
asookazian@asookazian-desktop:/opt/jboss-seam-2.2.1.CR1/examples/booking:10:30 PM:$ant clean explode
Buildfile: build.xml
clean:
initcopy:
initpoms:
[echo] Setting up dependencies
Build Failed
/opt/jboss-seam-2.2.1.CR1/build/common.build.xml:95: The following error occurred while executing this line:
/opt/jboss-seam-2.2.1.CR1/build/utilities.build.xml:18: Directory /opt/jboss-seam-2.2.1.CR1/classes/poms creation was not successful for an unknown reason
Total time: 0 seconds
How can I install Ant 1.7.0 (i.e. an older version of an existing package)?
Code:
asookazian@asookazian-desktop:/opt/jboss-seam-2.2.1.CR1/examples/booking:10:31 PM:$sudo apt-get install ant=1.7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '1.7.0' for 'ant' was not found
I downloaded the zip file for 1.7.0 but I need to redo all the symbolic link stuff, no?
Code:
asookazian@asookazian-desktop:/usr/bin:10:34 PM:$ls -la ant | less
Code:
lrwxrwxrwx 1 root root 20 2010-03-23 06:15 ant -> ../share/ant/bin/ant
I'd like to keep both versions of the ant package in my Ubuntu 9.10 system if possible...