Programming :: Write Synatax To Delete Stuff Older Than 8 Days?
Mar 31, 2011
I 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
I 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
I 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?
find -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?
I 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.
I 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.
1. How can I set the TTL to 2 days for all stuff cached by dnsmasq?
2. When I go to [URL] from my browser and then execute [URL] the query time returned is > 0 ms. When i execute it again it is 0 as it should be. So is dnsmasq not caching the domains looked up by my browser or what? in /etc/resolv.conf I have only 127.0.0.1 and for the upstream servers I have a different file that is only used by dnsmasq.
I want to make the script to copy all folders which older than 7 days from Linux server to Windows server by Samba. And make it automatically by using cron
Seem my rotation part is not removing files older than 90 days. Anybody know what is wrong?
Code: #!/bin/sh #navigate to the desired backup location cd /public/backup/linux #dump the MySQL entirely, output file is dated mysqldump -u root -pmt1jxz68f2 --all-databases > "`date +%Y%m%d`.sql" #backup the web folder
I'm trying to truncate a postfix Maildata directory for one of our users. I want to be able to move any files older than <n> days to a new location, but also copying the relevant directory structure. This should be doable in the one comman. I've used find to locate the files, and mv to move them, but I can't figure out how to build the directoryt structure on the fly in the new location.
I want Firefox to delete history after several days. Can I configure it this way?"Remember my browser history for at least..." is not the option which does it, right?
I want to capture a mms stream daily. All works well with that, but I also want to delete any mpg files that are captured from the stream that are more than 7 days old. Will this command work?
I decided to install a game under Wine. It didn't work so I uninstalled it. The game still shows up under the Wine section. I tried going to the uninstall in the game folder and it said "Failed to change to directory '/home/user/.wine/dosdevices/c:/Program Files/Ubisoft/Gearbox Software/BrothersInArmsEiB/System' (No such file or directory)". When I go to Wine -> Uninstall Wine Software it doesn't show up, but the folder is still under wine -> Programs.
I brought up the directory and the folder doesn't exist. How can I remove it from the programs list under wine?
I logged in via ssh to a computer and I can delete stuff that I should not be able to delete. I figured if the owner is different and the group is not mine and iit is 744 I should not be able to delete it...so I tested with "file1"..and I dont see my mistake:
users are "itv-storage" and "admin" on pc. HTML Code: itv-storage@pc:/RAID5/storage/test$ ls -la total 12 drwxrwxrwx 3 admin admin 4096 2011-03-16 19:28 . drwxrwxrwx 9 admin admin 4096 2011-03-16 18:37 .. -rwxr--r-- 1 admin admin 0 2011-03-16 19:28 file1 drwxrwxrwx 3 itv-storage itv-storage 4096 2011-03-16 18:46 folder1 itv-storage@pc:/RAID5/storage/test$ rm file1 rm: remove write-protected regular empty file `file1'? y itv-storage@pc:/RAID5/storage/test$ ls -la total 12 drwxrwxrwx 3 admin admin 4096 2011-03-16 19:32 . drwxrwxrwx 9 admin admin 4096 2011-03-16 18:37 .. drwxrwxrwx 3 itv-storage itv-storage 4096 2011-03-16 18:46 folder1 itv-storage@pc:/RAID5/storage/test$
i tried to install the kiba-dock. i wasnt successfully in any of my attempts. i would get through about half way then have to find somewhere else that had different commands and advice. how do i delete the stuff that did save as to not fill my computer with crap im not using?
Possible 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 ?
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.
I 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?
Is there any way a non-root user can programmatically determine which days the computer ran during, say, the last month?
The information is in /var/log/messages.* but those files are root:root 640.
Non of the world-readable /var/log files on the Slackware 13.0 development system can be used:boot Not present if boot logging not enabled (default). dmesg No timestamps. lastlog Not enough info. wtmp Rewritten on each boot so not enough info. EDIT: not correct: by default wtmp is rotated weekly and kept for one month as configured in /etc/logrotate.conf xdm.log Not present if xdm not used. Xorg.0.log Not present if X not run.
Code: mount /dev/sdd1 on /media/E0FD-1813 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush) cp 'Aankhon Aankhon Mein hum tum ho gaye deewane.mp3' /media/E0FD-1813/Music/sumeet/a cp: cannot create regular file '/media/E0FD-1813/Music/sumeet/a/Aankhon Aankhon Mein hum tum ho gaye deewane.mp3': Read-only file system The micro sd card mounts & works as fat32 in windows xp just fine.
I went to [URL] the other day, and I'm really impressed with the way, when you click on domain, it adds it to the cart WITHOUT A REFRESH. But what I really want to know is - how does it do the slick little effect when you click "Add to basket", when it "appears" on the right hand side?
share a mount"/RAID" on my server: 192.168.0.2 with everyone on my network.192.168.0.* From what I have listed below I am able to mount the share but I can not write or delete anything. It is almost like it is ro only permissions.
From the Server:
Code:
sudo cat /etc/exports [sudo] password for jesse: # /etc/exports: the access control list for filesystems which may be exported # to NFS clients. See exports(5).
[code]....
Eventually I need to share 192.168.0.2:/RAID on two OSX computers as well. I read some places where you need to add insecure to your /etc/exports on your server in order for the OSX client to access the the share.