LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   tar backup of an XP directory (https://www.linuxquestions.org/questions/linux-newbie-8/tar-backup-of-an-xp-directory-542166/)

fof3 03-31-2007 11:22 AM

tar backup of an XP directory
 
I have a dual boot system: linux and XP. As root I mounted XP with:
mount /dev/sda1 /mnt/windows
In the config for my backup script I have
DOS_C_BK_DIR=
Documents\ and\ Settings/Ed\ H/My\ Documents/

The error messages that I get when trying to backup XP are:

Backing Up
Documents\ and\ Settings/Ed\ H/My\ Documents/ on hebrews-Mar-31-07.win_c.tgz
tar: Documents\\: Cannot stat: No such file or directory
tar: and\\: Cannot stat: No such file or directory
tar: Settings/Edward\\: Cannot stat: No such file or directory
tar: Heaney/My\\: Cannot stat: No such file or directory
tar: Documents: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors

Any suggestions?

Jordi 03-31-2007 11:37 AM

I think I would be possibly a quotation problem in DOS_C_BK_DIR variable definition.
Man bash, section Quotation

dugas 03-31-2007 03:39 PM

Quotation Problem in backup script
 
You probably need to put quotations around your variable when calling tar.
Try something like:

Code:

#!/bin/bash

DOS_C_BK_DIR=A\ Test\ Directory

tar -cf test.tar "$DOS_C_BK_DIR"



All times are GMT -5. The time now is 07:15 AM.