Cron/ssh To Remove Folders Older Than X Days

Feb 27, 2009

I'm trying to write a cron/ssh to remove recursive folders in a "data" folder that is older than X days.

I've been able to remove files, but not folders.

This is the code I have so far, but if someone can point out how to remove folders older than X days, that'd be great ........

View 4 Replies


ADVERTISEMENT

Cron Job That Deletes Backup Files Older Than 5 Days

May 31, 2009

This is on a RHEL 4 Box.

I want to create a cron job that deletes backup files that are older than 5 days. I have created a shell script (/usr/local/src/runjob.sh) that runs successfully from the SSH command line:

Code:
#pwd
/usr/local/src
#./runjob.sh
Here is the script:

Code:
#!/bin/sh
#

#
find /usr/local/apache/sites/*/BACKUPS/ -maxdepth 1 -atime +5 -iname 'test*.txt' -exec rm {} ;
Script has 777 permissions and is owned by root.

I have the following entry in crontab:

Code:
10 12 * * * /bin/sh /usr/local/src/runjob.sh >/dev/null 2>&1

As shown in the cron log, the job does run, but it does not delete the files. And there are files older than 5 days in the directory that meet the find criteria.

View 12 Replies View Related

Deleting Files Older Than 30 Days

Jan 31, 2008

On a Red Hat server, how can I delete files in a specific directory that are older than 30 days?

View 7 Replies View Related

Deleting Spam Older Than X Days Need A Simpler Solution

Jan 21, 2009

I have a Bash script that deletes Spam from all users .Spam mailboxes that is older than X number of days

Currently I just list the paths to each mailbox i.e.

/var/vmail/Domain1.com/Mailbox1/.Spam/* -type f -mtime +5 -exec rm {} ;
/var/vmail/Domain1.com/Mailbox2/.Spam/* -type f -mtime +5 -exec rm {} ;
/var/vmail/Domain2.com/Mailbox1/.Spam/* -type f -mtime +5 -exec rm {} ;
/var/vmail/Domain2.com/Mailbox2/.Spam/* -type f -mtime +5 -exec rm {} ;

This is becoming unmanageable as the number of mailboxes grows I have to add each to my script

I tried putting wildcards in i.e.

/var/vmail/*/*/.Spam but this does not work

Is there a way to do this? Maybe running some kind of command to create an array of paths then looping through them?

View 5 Replies View Related

Remove Empty Folders And Remove From A Db

Jul 22, 2009

ive got a site which auto creates subdomains and installs a script automaticly and inserts details into a mysql db. i have had some issues recent so have loads (talking 100s) of folders that are empty which i need to remove, and to remove the details of said folder from db also. any ideas how i can do this, using plesk control panel so removing the subdomain via plesk cli may be the best way in that respect but the db is external to plesk so that would not be edited

View 0 Replies View Related

Virpus = Ticket 11 Days Old, Started Working On Issue 6 Days Ago, No Word For 4 Days

Nov 28, 2008

Virpus = Ticket 11 days old, started working on issue 6 days ago, no word for 4 days!

Thats Virpuss customer service and its plain silly.

View 11 Replies View Related

Cron Command Remove File Not Working

Jan 1, 2007

I have edited /var/spool/cron/root file

and I've added this line:

*/1 * * * * rm -f /tmp/*.pl

and I have created file lol.pl

and after 10 minute file is still there, why?

View 4 Replies View Related

Servage Say "we Give 14 Days Grace" But Then Suspend Account In 5 Days

Apr 5, 2008

I guess you can fugure my account expired with servage.
but to tell you the truth, I am so P OFF at them

I opened a ticket on my last day and asked if I can move it from 14 months (that I started with) to a 6 months renewal because I could'nt afford to pay the £74 they wanted, and apologised for this. They said I'd have to pay the 74 pounds first and then change my billing to 3 or 6 months.....

I replied saying can I then pay a sum now and a some next week. as I don't have that with me at the moment but wednesday 9th April I wil be able to remew it all

They replied with:

"Hello Ahmed
there is 14 days grace period for customers before account gets suspended."

So I thanked them very much, because like that, instead of paying in installments, I can just pay them the whole amount before the grace period was over, otherwise I would've backed up my data and moved it another server, or on my computer till I remew the whole amount....

5 days later (today), I log on to my account, and it has been suspended as I hav'nt paid for 5 days...thats 9 days before the "grace period"

and now all my domains have this dirty suspended page that they have, and I bet I lost half my members and customers like this, as when I see this page on any domain I enter I never go back to it!

I say to my self its my falt, I should've paid when I had to.....but money was tight, and I told them....and they gave me the 14 days, I did'nt ask for anything, but I thought backing up all my sites and my webdriver that I have with them would take me ages, plus the pages have alot of content that would be a hassle, if I have a "14 days grace period".

This is the first time servage have lied to my face, and not by answering a question with yes or no, by saying a feature they have that does'nt exist and but wednesday I bet all my customers and members would've found somewhere else to hang out, as I only contacted them through the mail server on the site and my forum, now I can't even right "we will be back soon....don't go away",

I thought I warn you guys about this grace, if you have an account with them make sure your ready to renew before it expires, and don't believe most of the stuff that they say.

OMG, I used to promote for these people, and tried hard to always say good stuff about them, you see my sig, it was a promotion for them with a coupon code (that I dredfully apologies about to the administration for not reading the rules properly), and I get in return a lie straight in my face with no warning and no way of accessing my database what so ever.
Just be warned Guys, don't believe everything they say to you and backup all the time because you never know why they suspend your account.....even if your on thew right track

View 6 Replies View Related

[Powervps] Older VPSs Are Better Then Newest

Aug 7, 2007

what's going inside my provider Powervps/Defender hosting, they are offering now 25% OFF of new customers + triply bandwidth.

Curent customers are not allowod to get this offer, until they order a new VPS and cancel the older.

I'm asking, because i feel, it's samething, why they don't go upgarading the account throughly with keeping IPs and data..? why do old customers need to cancel the old VPS then they go get a new VPS..?

are Old VPSs powerfully then the newest..? any informations...?

View 6 Replies View Related

How To Find And Delete Images 1 Year Older?

Nov 4, 2009

I run a photo image hosting. how do I find and delete photos that are 1 year older?

Can this be done by GUI?

Command?

Is there a tool for this?

View 9 Replies View Related

How To Delete All Mails On Server Older Than X Years

Apr 6, 2008

Is there a script for whm that deletes all mails older than XX years for all accounts on the server?

View 1 Replies View Related

Plesk 11.x / Windows :: Install Older WordPress Version?

Nov 4, 2013

how to install older version of WordPress - version 3.7 has just come out and it is the only version I can install via the Plesk panel but unfortunately half of the themes out there only support up to 3.6

View 6 Replies View Related

C99Shell Folders?

Jul 30, 2009

I found these folders in the root

/usr/bin/c99

/usr/include/boost/numeric/interval/detail/c99_rounding_control.hpp

/usr/include/boost/numeric/interval/detail/c99sub_rounding_control.hpp

what are these ? is it normal folders ? or somebody hacked our server?

what shall I do?

View 10 Replies View Related

IIS 5.1 - Browsing Folders

May 8, 2008

Well I finally got around to getting my IIS up and running which will save some time with uploading various files to check that they are working correctly but now I have run into a new problem. What used to happen with my IIS is it would list out all of the folders which I had in the wwwroot and I would simply navigate through and select which site needed to be tested.

At the moment, I have cleared out the wwwroot folder entirely since all of the stuff in there was to do with a "Windows XP Professional" page which appeared upon installation.

However, now that I don't need it anymore, I decided to clear it out and test IIS out by making a new folder called "sites" into wwwroot. Now though, it simply comes up with a "Directory Listing Denied. This Virtual Directory does not allow contents to be listed." error message, even though I have changed the permissions on the wwwroot folder to allow writing etc.

Could this be because it's IIS 5.1 and I need to install IIS 6.0 instead or is something else wrong? I know for a fact that my operating system (Windows Media Center Edition 2005) will do this list as I have had it before, back before I installed Vista and then decided to come back to MCE.

View 3 Replies View Related

Nobody Folders And Delete

Jun 29, 2008

when people run a forum and the template and forumdate folders may created some files with nobody permission,

the user could not delete them by the user themself,

and need admin login as root with ssh to delete those,

and let the files permission can run as the user instead of nobody.

the server is centos with cpanel and suexec.

View 5 Replies View Related

.htaccess And Folders

May 22, 2007

In the public_html directory, I have

php_value user_agent "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0"
<IfModule mod_security.c>
SecFilterScanPost
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Errordocument 404 /404.html
RewriteCond %{REQUEST_FILENAME} !.(jpg|jpeg|gif|png|css|js)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php [L]
</IfModule>

Then I created a new directory named caller

There is an exact same .htaccess in public_html/caller

However, the .htaccess in the public_html directory rewrites all request to index.php

.htaccess in public_html/caller rewrites all request to /caller/index.htm

The thing is when I access
[url] whatever the one that's called is /public_html/index.php

How can I arrange so that the one called is /caller/index.htm?

View 1 Replies View Related

Can I Delete These Folders From My Ftp

Mar 17, 2007

I heard the following folders were used by frontpage.

_private
_vti_bin
_vti_cnf
_vti_log
_vti_pvt
_vti_txt

I was wondering can i delete these folders if i'm not using frontpage ?

View 4 Replies View Related

Site Down For 4 Days

Jan 24, 2009

My site is down for about 4 days now. The hosting company's website support area is not accessible either. I do not have access to phpmyadmin. No one from the company is contacting me to let me know what the problem is. What can I do to bring my site back to life again?

View 14 Replies View Related

My 3 Days With VerityNet.net

Aug 1, 2008

I want everyone to know that the purpose of this post is to ask for help, and nothing else.

I bought a VPS from VerityNet one night. The next afternoon,I found out that my server was not setup yet and I had to call in for it to be manually setup. Great! Now I can get going, except for some reason I am not able to login to their PPP (Parallels Power Panel) and not able to login via Remote Desktop with the username and password supplied in the e-mail. So, I called in and told them I was not able to login, so he suggested a password reset. He said he would send me the new password via e-mail, but it took almost until next morning (Today). I tried to login using the new password for both Remote Desktop and PPP and it has failed to work, again. Next, I went back on their website to pull up the 1800 number to call them (By the way, this is the SAME number that I used Yesterday.).

When I dialed that number, it saids "This mail box does not exist".

What should I do at this point?

A) Stay with them, and try to work things out.

B) Get a refund

C) Stay with them, and ask for compensation for the 3 days.

View 14 Replies View Related

Bandwidth >> 200 GB In 5 Days

Jun 7, 2007

Today I noticed huge bandwidth usage on one of my site. This site is a picture site and average bandwidth usage was about 2 - 3 GB / day. But during last 4-5 days, this site has use more than 200GB of bandwidth.

After going thru the logs, I find that an email (or more than one) is in circulation having hotlinks to almost all the images (over 2000 high quality pictures) in one email.

This email has been send to thousands of ppl by some group / person. Now these emails blowup all my bandwidth without any page view / ads being served. I was really horrified to see this. In panic I renamed the folder holding the pictures and changed all my html files pointing to new folder.

But this does not seem to be the solution. Again someone could do the same thing again and again. Further, if I am changing the folder / location of pictures, I don't know if it will affect indexing of images by goggle images as this is a main source of visitor at my site.

Can I do something to stop this miss-use? I really lost money due to this over usage. How can I make sure that this thing is not repeated with my site?

View 5 Replies View Related

VPS Hosters These Days

Jul 26, 2007

It seems there's a shake-up going on in the VPS business, first BuyaVPS has issues with network, X1services with Cpanel problems, PrimaryVPS not responding for 9 hours, myVPShost downtimes, SolarVPS double-billing, the list just goes on and on.

I've only seen 2 good reviews lately: Wiredtree.com and Imountain.com. JaguarPC gets good comments and that Rocksomething company does too.

What's up with the OTHER providers? Please post your postive reviews with any companies you are with right now. Please don't post any more negative ones, there are too many already

View 14 Replies View Related

SSL Certificates Works For Folders?

Jan 13, 2008

Say i have domain zzzzz.com and have some folders say a, b and c

would ssl if installed for main domain zzzzz.com work for https://zzzzz.com/a and so on ? or would wildcard ssl be required for that ?

And what if that /a folder is actually a subdomain, but since you can access subdomains via url/folder instead of folder.url would ssl work on it using url/folder option instead of subdomain url ?

View 12 Replies View Related

Chmod For Public_html And Other Folders

Jul 24, 2009

what should be ideal chmod permission for public_html and other folders.

is 755 fine ? what is most secure one

View 14 Replies View Related

Finding And Chmod The Www Folders

Oct 23, 2009

i need to find al www folders within home directory with 777 permissions and need to chmod to 750.

if possible post the command to do it

View 8 Replies View Related

Unable To Delete Folders In Ftp

Mar 28, 2009

im using fireftp and i chmod the folders to 777 but it seems that im still unable to delete the folders as i get the message 550 directory not empty etc.

View 9 Replies View Related

Emails Going To SPAM Folders

May 15, 2008

I can send e-mails out but many times they go directly to the recipient's SPAM box.

Also, my server cannot send to any company e-mail that uses MXLogic.net's services.

Going to [url]<--My server IP is on ZERO blacklists.

/etc/resolv.conf appears correct
/etc/hosts also appears correct

Is there something that I am overlooking?

View 3 Replies View Related

Best Permission For SMF Files And Folders

Feb 22, 2008

I'd like to know how to secure an SMF site. Is the default permission good enough?

View 4 Replies View Related

Accessing Shared Folders

Jul 1, 2008

I have server which all files and folders are stored on. Now there are a couple of folders which are only accessible by one machine at present and all the other machines when they access the folder it is displayed as empty. I have checked all permisions and all machines viewing of files settings are the same and folders accessible by all machines have the same settings as the couple which are only accessible from this one machine.

If I copy and paste the folder all machines then have access to the folder from although this would be a lengthy exercise for the full hard drive.

View 0 Replies View Related







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