System Backup

Gala

Verified User
Joined
Jun 23, 2004
Messages
7
I run the system backup daily.
But I just want to keep 2days of it.
How can I do that ?

I don't want to delete it manually:( :confused:
 
Probably the easiest way would be to write a shell script that would be executed after the backup is run. It would look in the backup directory, determine how many backups are there and if there are more than 2, delete the oldest one.
 
jmstacey said:
Probably the easiest way would be to write a shell script that would be executed after the backup is run. It would look in the backup directory, determine how many backups are there and if there are more than 2, delete the oldest one.

:( But I don't know how to write this script...
Any manual:confused:
 
The script should be on the backup server.

Start by configuring the account that's going to hold the backups (the account on the ftp server.

Inside the user's home directory, create a directory named backup.

Then in the systems backup configuration, tell the system backup to write to the backup directory.

Create a cron job on the server holding the backup, to do the following as tje same username:

rm -Rf backup-old
mv backup backup-old
touch backup-old

Then run this script a minute before the backup starts on the server you're backing up.

After the second cycle your user should have two subdirectories:

/backup

and

/backup-old

and backup should always hold the most current backup and backup-old should always hold the older backup. Each backup will be in a date directory so you'll know what day it was made.

We use a method similar to this to manage backups for lots of backups on several backup servers. We'd love to have the code written into sysbk to do it for us so we don't have to write any scripts to run on the backup machine, but we'd like to see it done on the DA level or on the sysbk level, and not have to worry about a custom script ourselves.

Perhaps we'll donate this to the community at some point.

Jeff
 
I am looking foward to create my own scritps not just to do the same as the original poster, but for some other automatization project in my server..

Is there a good manual or web site with information for complete begginers on this matter?

Also,

Ia m not sure what language is used to do this scripts..

Regards,

Dec
 
It sounds as if you want to write scripts but you have no experience with Linux administration and don't know where to start.

If that's the case, then I highly recommend the book "Linux for Dummies". It starts at the beginning and walks you through gently.

Then afterwards, when you feel quite comfortable with linux, any of the good linux systems administration books.

Jeff
 
jlasman said:
The script should be on the backup server.

Start by configuring the account that's going to hold the backups (the account on the ftp server.

Inside the user's home directory, create a directory named backup.

Then in the systems backup configuration, tell the system backup to write to the backup directory.

Create a cron job on the server holding the backup, to do the following as tje same username:

rm -Rf backup-old
mv backup backup-old
touch backup-old

Then run this script a minute before the backup starts on the server you're backing up.

After the second cycle your user should have two subdirectories:

/backup

and

/backup-old

and backup should always hold the most current backup and backup-old should always hold the older backup. Each backup will be in a date directory so you'll know what day it was made.

We use a method similar to this to manage backups for lots of backups on several backup servers. We'd love to have the code written into sysbk to do it for us so we don't have to write any scripts to run on the backup machine, but we'd like to see it done on the DA level or on the sysbk level, and not have to worry about a custom script ourselves.

Perhaps we'll donate this to the community at some point.

Jeff


That means you have written the similar script into sysbk ?
 
No, we've never written it into sysbk; we run it on the backup servers.

Jeff
 
jlasman said:
It sounds as if you want to write scripts but you have no experience with Linux administration and don't know where to start.

If that's the case, then I highly recommend the book "Linux for Dummies". It starts at the beginning and walks you through gently.

Then afterwards, when you feel quite comfortable with linux, any of the good linux systems administration books.

Jeff

I am definitely not the most experienced Linux user, I don't event consider myself a server administrator, but i am fully cable to administer my own servers (Keep them up to date and secure) with the help of the community, my own resources and professional services for the most complex cases if needed.

I appreciate your concern and would appreciate it even more if you could provide and specific answer to my question.

Regards,

Dec
 
I did.

You wrote:
Is there a good manual or web site with information for complete begginers on this matter?

and I responded with the name of a good manual.

Jeff
 
Back
Top