Changeset 2754
- Timestamp:
- 22/09/2010 22:12:02 (20 months ago)
- Location:
- box/trunk
- Files:
-
- 3 edited
-
bin/bbackupquery/BackupQueries.cpp (modified) (3 diffs)
-
bin/bbackupquery/documentation.txt (modified) (1 diff)
-
test/bbackupd/testbbackupd.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/bin/bbackupquery/BackupQueries.cpp
r2699 r2754 1952 1952 { 1953 1953 // Check arguments 1954 if(args.size() != 2) 1955 { 1956 BOX_ERROR("Incorrect usage. restore [-drif] <remote-name> <local-name>"); 1954 if(args.size() < 1 || args.size() > 2) 1955 { 1956 BOX_ERROR("Incorrect usage. restore [-drif] <remote-name> " 1957 "[<local-name>]"); 1957 1958 return; 1958 1959 } … … 1995 1996 return; 1996 1997 } 1998 1997 1999 if(dirID == BackupProtocolClientListDirectory::RootDirectory) 1998 2000 { … … 2000 2002 return; 2001 2003 } 2002 2003 #ifdef WIN32 2004 2004 2005 std::string localName; 2005 if(!ConvertConsoleToUtf8(args[1].c_str(), localName)) return; 2006 #else 2007 std::string localName(args[1]); 2008 #endif 2006 2007 if(args.size() == 2) 2008 { 2009 #ifdef WIN32 2010 if(!ConvertConsoleToUtf8(args[1].c_str(), localName)) 2011 { 2012 return; 2013 } 2014 #else 2015 localName = args[1]; 2016 #endif 2017 } 2018 else 2019 { 2020 localName = args[0]; 2021 } 2009 2022 2010 2023 // Go and restore... -
box/trunk/bin/bbackupquery/documentation.txt
r2637 r2754 120 120 < 121 121 122 > restore [-drif] <directory-name> <local-directory-name>122 > restore [-drif] <directory-name> [<local-directory-name>] 123 123 124 124 Restores a directory to the local disc. The local directory specified 125 must not exist (unless a previous restore is being restarted). 125 must not exist (unless a previous restore is being restarted). If the 126 local directory is omitted, the default is to restore to the same 127 directory name and path, relative to the current local directory, 128 as set with the "lcd" command. 126 129 127 130 The root cannot be restored -- restore locations individually. -
box/trunk/test/bbackupd/testbbackupd.cpp
r2510 r2754 2071 2071 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 2072 2072 2073 // Try a restore with just the remote directory name, 2074 // check that it uses the same name in the local 2075 // directory. 2076 TEST_THAT(::mkdir("testfiles/restore-test", 0700) == 0); 2077 2078 compareReturnValue = ::system(BBACKUPQUERY " " 2079 "-Wwarning " 2080 "-c testfiles/bbackupd.conf " 2081 "\"lcd testfiles/restore-test\" " 2082 "\"restore Test1\" " 2083 "quit"); 2084 TEST_RETURN(compareReturnValue, 2085 BackupQueries::ReturnCode::Command_OK); 2086 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 2087 2088 // check that it restored properly 2089 compareReturnValue = ::system(BBACKUPQUERY " " 2090 "-Wwarning " 2091 "-c testfiles/bbackupd.conf " 2092 "\"compare -cEQ Test1 testfiles/restore-test/Test1\" " 2093 "quit"); 2094 TEST_RETURN(compareReturnValue, 2095 BackupQueries::ReturnCode::Compare_Same); 2096 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 2097 2073 2098 // put the permissions back to sensible values 2074 2099 #ifdef WIN32 … … 2083 2108 0755) == 0); 2084 2109 #endif 2085 2086 2110 } 2087 2111
Note: See TracChangeset
for help on using the changeset viewer.
