Link to home
Start Free TrialLog in
Avatar of Jason Yu
Jason YuFlag for United States of America

asked on

how to use rsync to backup linux files

I got a hard task to update a backup script. when I was reading the script, I have several places can't understand.

1. what is date function for on line 41.
2. /usr/bin/rsync -arv --files-from=/scripts/backuplist / $bkdisk/backup$d8t
Is this command the line to run the backup job to harddisk.
3. what is the date functiona after the above command for.
4. what do the numbers mean?
sleep 20
rm -rf $(find $bkdisk/ -maxdepth 1 -mtime $delDays|grep backup)
rm -rf $(find /u1/backup/DACS/ -mtime +2|sed '1 d')

I am new to linux scripting, thank you for any comments.
bksys.rsync.txt
Avatar of Tintin
Tintin

1.  It's a timestamp so when you look at the log, you know what time it runs

2.  Yes

3.  See 1

4 .  sleeps for 20 seconds

the rm/find commands are deleting old backups.
Avatar of Jason Yu

ASKER

thanks for reply, then what do the numbers in the following lines mean?
$1 - $4.


echo -e "To: $1
From: $host
Subject: $2
$3 " | /usr/sbin/sendmail $4
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial