Script for taking backup of desktop files.

Hi Friends,

I need help. I have around 100 users. I want to take date wise backup of files which are on desktop for every user.

My user directory path is -: /home/dr/<user_name>/Desktop

1) Script has to run on a perticular time everyday
2) Script has to take backup of all files present in "Desktop" directory
3) Make a tar with name "yyyy-mm-dd-desk-files"
4) Make directory outside "Desktop" with name "Desktop-Backup", if already exist then don't make this folder.
5) The tar have to moved in this folder.
6) Remove the files from "Desktop" directory. (i.e. Desktop should be empty)
7) Mail the status that "Backup Successful"

Catchy title:

Sorry I removed the "You are subscribed..." bit!

But no-one is going to do everything for you.

Show us what you have tried so far.

If it's a homework question, please post it in the appropriate forum.

Thanks.

I made this script......

#! /bin/bash
 
# Variables
location=/home/dr/parag.n/Desktop
directory=*
backuplocation=/home/dr/parag.n
log=/home/dr/parag.n/backup.log
 
echo -e �\nBackup started: `date`� >> $log
 
if [ -d $backuplocation ]; then
 
mkdir -p $backuplocation/`date +%y-%m-%d`
cd $location
tar -zcvf $backuplocation/`date +%y-%m-%d`/Desktop-Files.`date  +%H-%M-%S`.tar.gz $directory
rm -fr *
echo � completed: `date`� >> $log
mv $log $backuplocation/backup.log
echo -e �\n � Backup completed �\n�;
else
echo � FAILED: `date`� >> $log
echo -e �\n� WARNING: ��
echo -e �� BACKUP FAILED �\n�;
fi

In this "parag.n" is my home directory. But I have many users. How can i take backup of all of them? & How could i get a mail after finishing backup?