Remove all files in directory except last 20

I have question why is my cmd for “removing all files in directory except last 20” not working within cron but in command prompt yes. * * * * * ls -1tr /home/testusr/test | head -n -20 | xargs -d ‘\n’ rm -f > /var/opt/check.log 2>&1 Directory contains let say 100x files which are named … Read more

Script to delete certain folders based on the time

I need to create a bash script that will remove folders containing backups for specific days. I need to KEEP following: a) files\folders created on FRIDAY @ 23:30 b) files\folders created on the beginning of month (1st of month) c) the most recent two weeks Any suggestions\starting points? Input is much appreciated.. Tomek Answer tmpreaper … Read more

What options do I have if my linux box is compromised? [duplicate]

This question already has answers here: Closed 10 years ago. Possible Duplicate: My server’s been hacked EMERGENCY I have put all security meaures and log monitoring tools. Now but i don’t know what to do if find out the there is some rootkit on my system. If i have live sites running on my system … Read more

One SQL, lots of SharePoint 2010 Servers, and lots of Databases to clean

I have a dedicated server running SQL server and many web servers running SharePoint 2010 installations. All the SharePoint web servers are using the same SQL server for storing/creating databases. As I know, When SharePoint is installed it creates a collection of databases for itself to work (around 8 or 10). Two Questions: How can … Read more

Unable to Update-FileDistributionService due to old exchange server entry

I am getting following error when I a trying to update File Distributionservices as shown below. The error pops up with name of my old CAS server which means mailbox server still have entry. Please assist how to get rid of this. I want to remove server entry : vexchangecas from my mailbox server as … Read more

Does anyone know how to scan through a Java Keystore and remove all the expired certificates?

I have in the past made a list of all the alias’s that were expired and then made a forloop in CMD to then go through and remove all of them but I was wondering if anyone knew of a perl script or anything that would both find the expired certs then remove them Answer … Read more

Protect users from accidental delete

I am currently designing an incremental, rotative backup system for a remote filesystem to be accessed over SSHFS. There is this one aspect I still haven’t figured out: Protecting the users from their own mistakes, from accidentally deleting some files without even noticing. A backup can’t protect them against this, as the user might not … Read more

Centos: How to revert to a revert back to an earlier version of a package?

I have installed version 6.4 of filebeat and then I decided to revert back to 1.3. So I used the command ‘yum remove filebeat-6.4.0-x86_64.rpm’, to remove it, when I try to install filebeat 1.3 I get the error: package filebeat-6.4.0-1.x86_64 (which is newer than filebeat-1.3.1-1.x86_64) is already installed file /etc/filebeat/filebeat.yml from install of filebeat-1.3.1-1.x86_64 conflicts … Read more