История изменений
Исправление saahriktu, (текущая версия) :
#!/bin/bash
make_my_backup() {
TEMPDIR=`mktemp -d`
BAKARCHIVE="bak-$1-`date +%Y.%d.%m`.tar.xz"
find /media/Share/ -type f \( -iname '*.doc' -o -iname '*.ppt' -o -iname '*xls' \) -exec cp {} $TEMPDIR \;
tar cvfJ $BAKARCHIVE $TEMPDIR
mv $BAKARCHIVE /media/HardDrive/Backup
rm -r $TEMPDIR
}
sudo mount.cifs //192.168.1.15/d /media/Share/ --verbose -o username=Наталья
make_my_backup d
sudo umount /media/Share
sudo mount.cifs //192.168.1.15/с /media/Share/ --verbose -o username=Наталья
make_my_backup c
sudo umount /media/Share
Исправление saahriktu, :
#!/bin/bash
make_my_backup() {
TEMPDIR=`mktemp -d`
find /media/Share/ -type f \( -iname '*.doc' -o -iname '*.ppt' -o -iname '*xls' \) -exec cp {} $TEMPDIR \;
tar cvfJ bak-$1-`date +%Y.%d.%m`.tar.xz $TEMPDIR
mv bak-d-`date +%Y.%d.%m`.tar.xz /media/HardDrive/Backup
rm -r $TEMPDIR
}
sudo mount.cifs //192.168.1.15/d /media/Share/ --verbose -o username=Наталья
make_my_backup d
sudo umount /media/Share
sudo mount.cifs //192.168.1.15/с /media/Share/ --verbose -o username=Наталья
make_my_backup c
sudo umount /media/Share
Исходная версия saahriktu, :
#!/bin/bash
make_my_backup() { TEMPDIR=`mktemp -d` find /media/Share/ -type f \( -iname '*.doc' -o -iname '*.ppt' -o -iname '*xls' \) -exec cp {} $TEMPDIR \; tar cvfJ bak-$1-`date +%Y.%d.%m`.tar.xz $TEMPDIR mv bak-d-`date +%Y.%d.%m`.tar.xz /media/HardDrive/Backup rm -r $TEMPDIR }
sudo mount.cifs //192.168.1.15/d /media/Share/ --verbose -o username=Наталья make_my_backup d sudo umount /media/Share sudo mount.cifs //192.168.1.15/с /media/Share/ --verbose -o username=Наталья make_my_backup c sudo umount /media/Share