Hi james,
maybe you can help me on this problem;
assuming i have a directory /home/backup/psadump where i keep last 7 days backupfiles, well i use the following script to copy this directory every night out of the box in my NAS storage:
#!/bin/sh
smbmount //smbackup.dll.server.com/cc001/mnt/nas -o username=cc001,password=mypass
cd /mnt/nas
rm -rf backup
mkdir backup
cp -r /home/backup/psadump/* backup/
cd /
rm -f /root/nas_backup_notify.txt
ls -lR /mnt/nas/backup/ > /root/nas_backup_notify.txt
cat /root/nas_backup_notify.txt | mail -s "Server - Nas Backup Log `date +%F`"
[email protected]
smbumount /mnt/nas
# Done
I'm not so good as coder but i would like to be able to copy every night on my nas the last backup file only and not the entire directory with all the files inside. At the moment,as you can see, the copy process is not very smart, deleting every night the directory on the nas and then copying again the full local directory containing the same files already there .. except the last new one.
I don't know if i explained clearly my question ..
Can you help me with this?
Thanx in advance