You are not logged in.

#1 2009-01-02 13:45:33

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Backup Script with rsync

Hi,

i made my own backup script for daily backups to my NAS using rsync. it works but rsync still get's a few errors:
no directory error

 rsync: mkstemp "/mnt/nas_backup/BackupLaptop/daily/jelle/.nautilus/metafiles/.smb:%2F%2F192.168.2.101%2Fopenshare%2Fsoftware.xml.4J2AJW" failed: Not a directory (20)
rsync: mkstemp "/mnt/nas_backup/BackupLaptop/daily/jelle/.nautilus/metafiles/.x-nautilus-desktop:%2F%2F%2F.xml.yCbEZD" failed: Not a directory (20)

symlink error

 rsync: symlink "/mnt/nas_backup/BackupLaptop/daily/jelle/.icons/gnome-wine/scalable/categories/xfce-system-settings.svg" -> "preferences-system.svg" failed: Operation not supported (95)

Here is my backup script:

 #!/bin/bash
echo "mount share"
mount -t cifs //10.0.0.102/myshare /mnt/nas_backup -o username=admin,password=waa,lfs

#/home/jelle/rsnyc_exclude exclude file for home
#/home/jelle/etc_exclude  exclude file for etc

echo  beginning backup `date` >> ~/RsyncBackup.log
echo "pkg backup"

pacman -Qqe > ~/pkglist
mv ~/pkglist /mnt/nas_backup/BackupLaptop/daily/pkglist

echo "home backup"
rsync -arvHl --delete --exclude-from='/home/jelle/exclude_home' /home/jelle/ /mnt/nas_backup/BackupLaptop/daily/jelle >> /home/jelle/RsyncBackup.log


echo "/etc backup"
rsync -arvHl --delete --exclude-from='/home/jelle/exclude_etc' /etc/ /mnt/nas_backup/BackupLaptop/daily/etc >> /home/jelle/RsyncBackup.log 

echo backup finished `date` >> ~/RsyncBackup.log

My exclude files:

/home/jelle/.mozilla/firefox/*.default/Cache 
/home/jelle/backup 
/home/jelle/.Trash 
/home/jelle/.local/share/Trash/files
/home/jelle/Muziek 
/home/jelle/video
/home/jelle/.wine
/home/jelle/.gvfs
/home/jelle/maple12
/home/jelle/.nautilus
/home/jelle/.cache
/home/jelle/iso
/home/jelle/FrostWire
/home/jelle/.dropbox
/home/jelle/.kde4

Sadly rsync doesn't exclude the .nautilus directory, how could this happen?

Offline

#2 2009-01-02 14:27:14

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,896
Website

Re: Backup Script with rsync

http://tinyurl.com/9tqrg5

Try the dry run option to test your script do the other excluded dirs. get well excluded?


Mr Green

Offline

#3 2009-01-02 23:45:47

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Backup Script with rsync

I'd be excluding those smb and nautilus "directories"... A new installation is going to create them anyway.

As for the symlink errors, I'm guessing your NAS is formatted as FAT / FAT32 / NTFS?  These file systems don't support the concept of symbolic linking.

Offline

#4 2009-01-03 04:33:31

my0pic
Member
From: Melbourne, Australia
Registered: 2008-05-23
Posts: 206

Re: Backup Script with rsync

I had mixed results using an exclude list in the same form as yours until I started each exclude line with a "-". For example:

- /home/jelle/.mozilla/firefox/*.default/Cache 
- /home/jelle/backup 
- /home/jelle/.Trash

Though man rsync states you don't need the "-" at the start of an exclude line (of the exclude list), I found some directories where being missed.

Offline

#5 2009-01-04 11:18:15

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: Backup Script with rsync

@fukawi2 - the filesystem can't be FAT/FAT32/NTFS because it runs Linux smile So NTFS can't be it and FAT32 could be but i don't think FAT32 can handle 1 TB diskspace.

@my0pic: i saw some people use that, i will try using that.
Apart from the backup script cron still doesn't work :s .
This is my line in crontab -l

Last edited by jelly (2009-01-04 22:15:43)

Offline

#6 2009-01-04 21:44:57

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Backup Script with rsync

jelly wrote:

the filesystem can't be FAT/FAT32/NTFS because it runs Linux smile So NTFS can't be it and FAT32 could be but i don't think FAT32 can handle 1 TB diskspace

I think you're right about FAT32, but Linux handles NTFS very well using the NTFS-3G driver, so I'd still be thinking it's quite possibly using NTFS...

Offline

#7 2009-01-04 22:19:27

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: Backup Script with rsync

fukawi2 wrote:
jelly wrote:

the filesystem can't be FAT/FAT32/NTFS because it runs Linux smile So NTFS can't be it and FAT32 could be but i don't think FAT32 can handle 1 TB diskspace

I think you're right about FAT32, but Linux handles NTFS very well using the NTFS-3G driver, so I'd still be thinking it's quite possibly using NTFS...

For your interest, i can view the kernel log of my NAS tongue
Some output:

Dec 6 02:10:56  kernel:                    kjournald starting.  Commit interval 5 seconds
Dec 6 02:10:56  kernel:                    EXT3-fs: mounted filesystem with ordered data mode.
Dec 6 02:10:56  kernel:                    VFS: Mounted root (ext3 filesystem) readonly.
Dec 6 02:10:56  kernel:                    Freeing init memory: 84K
Dec 6 02:10:56  kernel:                    kjournald starting.  Commit interval 5 seconds
Dec 6 02:10:56  kernel:                    EXT3-fs: mounted filesystem with ordered data mode.
Dec 6 02:10:56  kernel:                    kjournald starting.  Commit interval 5 seconds
Dec 6 02:10:56  kernel:                    EXT3 FS on sda9, internal journal
Dec 6 02:10:56  kernel:                    EXT3-fs: mounted filesystem with ordered data mode.
Dec 6 02:10:56  kernel:                    SGI XFS with large block numbers, no debug enabled
Dec 6 02:10:56  kernel:                    fuse init (API version 7.8)
Dec 6 02:10:56  kernel:                    fuse distribution version: 2.7.3
Dec 6 02:10:57  kernel:                    Adding 128448k swap on /dev/sda5.  Priority:-1 extents:1
Dec 6 02:10:58  kernel:                    XFS mounting filesystem sda2
Dec 6 02:10:58  kernel:                    Ending clean XFS mount for filesystem: sda2
Dec 6 02:11:01  udhcpc[531]:               udhcpc (v0.9.9-pre) started
Dec 6 02:11:01  kernel:                    egiga0: link down
Dec 6 02:11:03  kernel:                    egiga0: link up, full duplex, speed 100 Mbps
Dec 6 02:11:04  udhcpc[531]:               Lease of 192.168.2.104 obtained, lease time 946080000
Dec 6 02:11:12  ifplugd(egiga0)[710]:      ifplugd 0.28 initializing.
Dec 6 02:11:12  ifplugd(egiga0)[710]:      Using interface egiga0/00:D0:4B:86:21:F1 with driver  (version: )
Dec 6 02:11:12  ifplugd(egiga0)[710]:      Using detection mode: SIOCETHTOOL

I is possible that the nas has nfts-3g driver, because you can plug in a usbstick or external hd and copy files to the nas.

Anyway, it uses Linux and that's cool:D.

Offline

#8 2009-01-05 02:09:16

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,222
Website

Re: Backup Script with rsync

I didn't know you had access to the logs that showed it runs EXT3 / XFS. I stand corrected and am sh!t out of ideas then tongue  Sorry sad

Offline

#9 2009-01-05 04:17:03

weasel8
Member
Registered: 2008-12-15
Posts: 149

Re: Backup Script with rsync

As for the missing files, perhaps they were temporary ones, and got deleted before the backup was done, or something.

Offline

Board footer

Powered by FluxBB