author | ar <ar> | 2004-01-22 21:50:55 (UTC) |
---|---|---|
committer | ar <ar> | 2004-01-22 21:50:55 (UTC) |
commit | 77ad4fd70864e36745dbee587ca959a2e56998a6 (patch) (side-by-side diff) | |
tree | 719ea0c8f1a1ecf9338ceb05c1b56169dc56dbed | |
parent | 2061145634f91239c986b25ecc8d1e10b95046b3 (diff) | |
download | opie-77ad4fd70864e36745dbee587ca959a2e56998a6.zip opie-77ad4fd70864e36745dbee587ca959a2e56998a6.tar.gz opie-77ad4fd70864e36745dbee587ca959a2e56998a6.tar.bz2 |
- exclude *.bck files from backup
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index 3500403..a00193d 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp @@ -220,65 +220,65 @@ void BackupAndRestore::backup() { QString backupFiles; if(getBackupFiles(backupFiles, NULL) == 0) { QMessageBox::critical(this, "Message", "No items selected.",QString("Ok") ); return; } setCaption(tr("Backup and Restore... working...")); QString outputFile = backupLocations[storeToLocation->currentText()]; QDateTime datetime = QDateTime::currentDateTime(); QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') + QString::number( datetime.date().day() ).rightJustify(2, '0'); outputFile += "/" + dateString; QString t = outputFile; int c = 1; while(QFile::exists(outputFile + EXTENSION)) { outputFile = t + QString("%1").arg(c); c++; } // We execute tar and compressing its output with gzip.. // The error output will be written into a temp-file which could be provided // for debugging.. qDebug( "Storing file: %s", outputFile.latin1() ); outputFile += EXTENSION; - QString commandLine = QString( "(tar -C %1 -c %2 | gzip > %3 ) 2> %4" ).arg( QDir::homeDirPath() ) + QString commandLine = QString( "(tar -C %1 -z --exclude=*.bck -c %2 > %3 ) 2> %4" ).arg( QDir::homeDirPath() ) .arg( backupFiles ) .arg( outputFile.latin1() ) .arg( tempFileName.latin1() ); qDebug( commandLine ); int r = system( commandLine ); if(r != 0) { perror("Error: "); QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n" + errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) ) { case 1: qWarning("Details pressed !"); ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); QFile errorFile( tempFileName ); if ( errorFile.open(IO_ReadOnly) ) { QTextStream t( &errorFile ); QString s; while ( !t.eof() ) { // until end of file... s += t.readLine(); // line of text excluding '\n' } errorFile.close(); pErrDialog->m_textarea->setText( s ); |