0

I need to delete backups older than x days and I'd like it to be automatic to a point. Is there a way to clear backups on my Minecraft server?

Richard
  • 8,502
  • 11
  • 47
  • 72
popcorn9499
  • 59
  • 1
  • 10

1 Answers1

1

You will use FIND command to do this, you will have to create a bash script and a CRON job.

Please read the man for FIND.

find /u1/database/prod/arch -type f -mtime +3 -exec rm {} \;

This command finds all the files under /u1/database/prod/arch and it's subfolders, that are "regular files" (-type f) not directories, device files or something like that, and that have been modified at least 3 days ago (-mtime +3) and then executes "rm " for those files.

LMZ
  • 61
  • 5
  • 1
    P.S. This is how you create a Cron Job, follow link.

    http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job

    – LMZ Jan 26 '14 at 02:58
  • Thanks Chris ive been working hard on learning linux but so far ive had fun :) – popcorn9499 Jan 26 '14 at 17:10