#! /bin/sh

# it is necessary to be positioned in the directory from which you need to archive
# when running 'tar c.. ...'

# And also to be positioned in the directory into which you wish to extract
# when running 'tar x.. ...'

# A test of the contents of a tar can be done by running 'tar t.. ...'

# tar cjf /mnt/m1-btrfs/tar/lv_home_`date +%F_%H-%M`.tar --exclude=lost+found .
# tar cjf /mnt/m1-btrfs/tar/lv_root_`date +%F_%H-%M`.tar --exclude=lost+found .
# tar cjf /mnt/m1-btrfs/tar/lv_share_`date +%F_%H-%M`.tar --exclude=lost+found .
# tar cjf /mnt/m1-btrfs/tar/lv_var_`date +%F_%H-%M`.tar --exclude=lost+found .

# for d in home root share var; do cd $d; pwd; cd ..; done

for d in home root share var;
do cd $d;
pwd;
tar cjf /mnt/m1-btrfs/tar/lv_${d}_`date +%F_%H-%M`.tar --exclude=lost+found .;
cd ..;
done
