Ditto what stevea said.
Also, unless you have a good reason to use 7z, I'd recommend using Linux-native tools. If you need 7z's LZMA2 compression, the
xz command does that:
Code:
tar cf - $dir | xz -9e > $backup.tar.xz
You can extract it with the graphical tool of your choice, or run:
Code:
tar xf $backup.tar.xz
If you do want to use 7z, I think the proper command is "7z a $backup.7z $sourcedir" ('a' for add, no '-r' needed – see the warning stevea mentioned).
---------- Post added at 02:54 AM ---------- Previous post was at 02:42 AM ----------
Quote:
Originally Posted by Argedion
I have directory /SDCARD/ConstantNameFolder/BDCES-*-*/*.*
|
If I understand correctly, "*.*" is supposed to match all files inside the BDCES-* directory? That's a DOS-ism, and not how it works in Linux: "*" matches all (non-hidden) files, but in this case you're better off working with the directory name directly.
Quote:
I've tried doing commands like this
7z -r /media/Storage/Phone/Nandroid/12345/BDCES-*-*/BDCES-*-*.7z /SDCARD/Nandroid/12345/
I get Error Incorrect Command Line
|
The *'s in the .7z file name won't do anything here, as the 7z files haven't been created.
I'm not sure I quite understand what you want to do, but here's my suggestion (NOT TESTED!):
Code:
# Set these variables as you need.
source_dir="/media/Phone"
backup_dir="/media/Storage/Phone Backups"
pushd "$source_dir"
for dir in BDCES-*
do
tar cf - "$dir" | xz -9e > "$backup_dir/$dir.tar.xz"
# 7z a "$backup_dir/$dir.7z" "$dir"
done
popd