Get the Linux notebook you have always wanted.  A portion of your purchase helps support maysville linux users group

Home  

 


  Create an account

Search


[x]  
 
 [x]
Categories Menu
· All Categories
· Commands
· Distro News
· General
· Link of the Week
· Linux Jobs
· Security
· Software
· Tips

 
Navigation
 
User Info
Welcome, Anonymous

Username:
Password:

(Register)

Membership:
Latest: hiobgiou
New Today: 0
New Yesterday: 0
Overall: 225

People Online:
Visitors: 4
Members: 0
Total: 4

 
hacker Beware
You have been warned!
We have caught 1478 shameful hackers.

NukeSentinel(tm) 2.5.14

 
Hot Downloads
 
  
Tips: Backup Script
Posted on Friday, September 17 @ 12:39:18 CDT by maysvill

Tips & Tricks Anonymous writes "Hi! I found this backup script on the web a while ago, and thought your users might like it. Should be commented enough to figure out what needs changed.

#!/bin/bash
## make sure you change this to suit your username and group names,
## plus backup locations and files to back up

date="`date +%Y-%m-%d`"
olddate="`date --date '5 months ago' +%Y-%m`"

# Zip, Create, one fiLesystem, absolute Paths, File:
## list all directories to be backed up here and location to back them up to
tar -zclPf "/backup/sysconfig-$date.tar.gz" /etc
tar -zclPf "/backup/www-$date.tar.gz" /data/www
tar -zclPf "/backup/username-$date.tar.gz" /home/username

# set permissions of backup files
chmod 600 /backup/*
## change username:usergroup to correct name:group
chown username:usergroup "/backup/username-$date.tar.gz"

# Remove all backups created 5 months ago (find -ctime could be used instead)
rm -f /backup/sysconfig-$olddate-*.tar.gz
rm -f /backup/www-$olddate-*.tar.gz
rm -f /backup/username-$olddate-*.tar.gz

# mail a message with the mail tool from the 'mail' package.
echo "Info: new backup created on `date` ($date)". | mail -s "backup created" username@localhost

Note: submitted by anonymous user, therefore I have no idea who to give credit to this script."

 
Related Websites

Related Links
 
Article Rating
Average Score: 0
Votes: 0

Please take a second and vote for this article:

Excellent
Very Good
Good
Regular
Bad


 
Options
 
Associated Topics

Linux Computer & Network SecurityTips & Tricks

The comments are owned by the poster. We aren't responsible for their content.

No Comments Allowed for Anonymous, please register

 
All content Copyright 2000 - 2008, Maysville Linux Users Group unless otherwise credited.
All Rights Reserved!
The opinions expressed by visitors to this web site are their own and not necessarily the opinions of the MLUG!


Web site powered by PHP-Nuke Web site powered by PHP-Nuke-NIP-76.0

You can syndicate our news using the file backend.php or ultramode.txt