Thread: [Dar-support] Backup in Windows XP
For full, incremental, compressed and encrypted backups or archives
Brought to you by:
edrusb
From: Joacim J <joc...@gm...> - 2006-02-04 11:41:05
|
I am writing a shell script that runs on windows XP OS and Cygwin For testing purpose I have a folder called "C:\Temp\My Folder". I will not make backup of the complete file system, only selected folders (incl. subfolders). The backup script is at C:\ looking like: ####################################### #!/bin/sh BACKUP_ARCHIVE_PATH=3D"Filez/Backup/Archive" BACKUP_ARCHIVE_FILE=3D"Backup_`date '+%Y-%m-%d_%H.%M'`.tar.gz" BACKUP_CURRENT_PATH=3D"C:/Filez/Backup/Current" BACKUP_FILE_FULL=3D"Backup_Full" BACKUP_FILE_INCR=3D"Backup_`date '+%Y-%m-%d_%H.%M'`" BACKUP_ITEM=3D"Temp/My Folder" BACKUP_LOG_FILE=3D"Backup_`date '+%Y-%m-%d_%H.%M'`.log" ##################################################################### # Usage ##################################################################### usage() { echo "Usage" } ##################################################################### # Pack and store old backups ##################################################################### packAndStore() { echo "Packing old backups and store them at ${BACKUP_ARCHIVE_PATH}/${BACKUP_ARCHIVE_FILE}" tar cfz ${BACKUP_ARCHIVE_PATH}/${BACKUP_ARCHIVE_FILE} ${BACKUP_CURRENT_= PATH} echo "Packing/Store finished" } ##################################################################### # Clean current backups ##################################################################### clean() { rm -f ${BACKUP_CURRENT_PATH}/* } ##################################################################### # Make a full backup ##################################################################### makeFullBackup() { echo "makeFullBackup" cd c:/ CMD=3D"dar -c ${BACKUP_CURRENT_PATH}/${BACKUP_FILE_FULL} -s 4490M -S 4485M -v -g \"${BACKUP_ITEM}\"" echo ${CMD} ${CMD} } ##################################################################### # Make a incremental backup ##################################################################### makeIncrementalBackup() { echo "makeIncrementalBackup" } #packAndStore clean makeFullBackup ####################################### The output when running the script is: ####################################### C:\>bash backupFull.sh makeFullBackup dar -c C:/Filez/Backup/Current/Backup_Full -s 4490M -S 4485M -v -g "Temp/My Folder" The [list of path] is deprecated, thanks to use the -g option instead Cannot read directory contents: ./System Volume Information : Error openning directory: ./System Volume Information : Permission denied Writing archive contents... -------------------------------------------- 0 inode(s) saved with 0 hard link(s) recorded 0 inode(s) not saved (no file change) 0 inode(s) failed to save (filesystem error) 38 files(s) ignored (excluded by filters) 0 files(s) recorded as deleted from reference backup -------------------------------------------- Total number of file considered: 38 -------------------------------------------- C:\> ####################################### The content of the folder(s) is: ####################################### C:\>ls -al "Temp\My Folder" total 0 drwx------+ 3 Joacim Ingen 0 Jan 25 23:41 . drwx------+ 9 Annelie Ingen 0 Jan 30 16:27 .. drwx------+ 2 G=E4st Ingen 0 Jan 17 23:10 Move_home C:\>ls -al "Temp\My Folder\Move_home" total 1876 drwx------+ 2 G=E4st Ingen 0 Jan 17 23:10 . drwx------+ 3 Joacim Ingen 0 Jan 25 23:41 .. -rwx------+ 1 G=E4st Ingen 1210248 Jan 13 12:07 EclipseCon2005_Tutorial8= .pdf -rwx------+ 1 G=E4st Ingen 698478 Jan 2 14:03 PC-tidningen_SKYPE.pdf -rwx------+ 1 G=E4st Ingen 7870 Jan 13 10:50 fsk.pdf C:\> ####################################### The created dar file contains nothing. ####################################### C:\Filez\Backup\Current>dar -l Backup_Full [data ][ EA ][compr] | permission | user | group | size | date =20 | filename ----------------------+------------+-------+-------+-------+---------------= ----------------+------------ ####################################### What is wrong?? -- Regards Joacim |
From: Denis C. <dar...@fr...> - 2006-02-04 13:49:50
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joacim J wrote: | I a m writing a shell script that runs on windows XP OS and Cygwin | [...] | C:\>bash backupFull.sh | makeFullBackup | dar -c C:/Filez/Backup/Current/Backup_Full -s 4490M -S 4485M -v -g | "Temp/My Folder" | The [list of path] is deprecated, thanks to use the -g option instead This message is reported when a command line word is given out of options argument, as you guess. This is strange for the given command-line as the "Temp/My Folder" seems properly quoted seen what is displayed. But it depends how the shell passes the arguments to dar (it could pass it this way: ... [-g] ["Temp/My] [Folder"] I suggest you call the exactly same command but directly from an interactive shell, if all works properly, this becomes from the way arguments are passed from the shell to dar, we will then see how to workaroud that. | Cannot read directory contents: ./System Volume Information : Error | openning directory: ./System Volume Information : Permission denied | Writing archive contents... | | the fact that you have nothing saved is a consequence of this previous problem. | -------------------------------------------- | 0 inode(s) saved | with 0 hard link(s) recorded | 0 inode(s) not saved (no file change) | 0 inode(s) failed to save (filesystem error) | 38 files(s) ignored (excluded by filters) | 0 files(s) recorded as deleted from reference backup | -------------------------------------------- | Total number of file considered: 38 | -------------------------------------------- [...] | -- | Regards | Joacim | Regards, Denis. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD5LDopC5CI8gYGlIRAnkIAJwJBkUtzmFmm49BsbeiHBN/xxRqIwCfXTVn 6UEGPYU7fNDBa796AJH7www= =bTqt -----END PGP SIGNATURE----- |
From: Richard F. <bi...@as...> - 2006-02-04 22:03:23
|
On 2/4/06, Joacim J <joc...@gm...> wrote: > makeFullBackup() { > echo "makeFullBackup" > cd c:/ > CMD=3D"dar -c ${BACKUP_CURRENT_PATH}/${BACKUP_FILE_FULL} -s 4490M -S > 4485M -v -g \"${BACKUP_ITEM}\"" > echo ${CMD} > ${CMD} Denis is exactly right: dar is seeing <<"Temp/My">> as the argument for -g, and <<Folder">> as an extra argument. Try: echo ${CMD} eval ${CMD} -Richard |
From: Joacim J <joc...@gm...> - 2006-02-05 11:58:54
|
Yes, Replacing ${CMD} with eval ${CMD} Did the trick! Now I can proceed with my setup, tanks! BR Joacim On 2/4/06, Richard Fish <bi...@as...> wrote: > On 2/4/06, Joacim J <joc...@gm...> wrote: > > makeFullBackup() { > > echo "makeFullBackup" > > cd c:/ > > CMD=3D"dar -c ${BACKUP_CURRENT_PATH}/${BACKUP_FILE_FULL} -s 4490M -= S > > 4485M -v -g \"${BACKUP_ITEM}\"" > > echo ${CMD} > > ${CMD} > > Denis is exactly right: dar is seeing <<"Temp/My">> as the argument > for -g, and <<Folder">> as an extra argument. > > Try: > > echo ${CMD} > eval ${CMD} > > -Richard > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmdlnk&kid=103432&bid#0486&dat=121642 > _______________________________________________ > Dar-support mailing list > Dar...@li... > https://lists.sourceforge.net/lists/listinfo/dar-support > -- Regards Joacim |