Results 1 to 4 of 4
Hai,
I am new to suse linux, in my working environment i have one mail server every day we will take backup using script, that backup will store in one ...
- 03-13-2009 #1Just Joined!
- Join Date
- Feb 2009
- Posts
- 6
write shell script
Hai,
I am new to suse linux, in my working environment i have one mail server every day we will take backup using script, that backup will store in one directory, but i want to move data when new backup will come that directory na automatically old backup should move to the another location like that i want script give any clues
- 03-13-2009 #2
If you have a regular naming scheme for your backups this is nice and simple. For example, lets assume that the most recent files to be backed up will be called:
mail-backup.tar.gz
and that when you will be bringing in a new backup, you want the old ones moved to the name:
mail-backup-01.tar.gz
In this case, all you have to do is put a line in your script which will rename the current backups to make room for the new ones:
You only need to move a few files each time if you just plan on keeping a few of the recent backups. If you plan on keeping all backups ever created, then you will want to have a more sophisticated naming scheme (e.g. Have you backups named with their respective dates tacked on to the filename so that there will never be any fear of overwriting a backup)Code:.... mv /path/to/mail-backup.tar.gz /path/to/mail-backup-01.tar.gz ... #Now you can have the backup part of the script here tar -<options> /mail/files /path/to/mail-backup.tar.gz
Hope that helpsLinux since: 2001
Gentoo since: 2004
- - - - - - - -
Translation:
I fix things until they break.
- 03-13-2009 #3Just Joined!
- Join Date
- Feb 2009
- Posts
- 6
shell script
Hai,
manually i know, but i want to put in to the script file,
for ex:
every day i am taking backup /backup directory, fine name back010309....like that, but after one week when the new backup will create na, old backup should move to the another directory, this thing i want to add in my backup script file
- 03-13-2009 #4
Sorry for being unclear, or maybe we are just on different wavelengths.
I meant that you could just put the mv command into your script. It would go into the script right before your backup commands so that your older backups have been moved/renamed before your newest backup file takes its place.Linux since: 2001
Gentoo since: 2004
- - - - - - - -
Translation:
I fix things until they break.


Reply With Quote