I made a save script, to save some directories in my
/home. To do that I loop through the directories in /home, and launch a save for each of them.
These directories contain jar files, and some
.txt. Properties and other directories. The first time I launch the script it worked great. I modified it, but yesterday when I try some feature it goes wrong and I can not find why.
I have this error when I use the
tar -cjf command to create .tar.zip archive.
tar: home/myFolder : impossible stat: no file or folder of this type
backupdate=$(date +%Y-%m-%d) dirbackup=/save/$backupdate mkdir $dirbackup list_dossier=`ls ../home` for server in $list_dossier do tar -cjf $dirbackup/$server.tar.zip home/$server done
I'm trying to keep this shape of save : a folder with name the date, and in it, X archves contain my X folders of my
#!/bin/bash backupdate=$(date +%Y-%m-%d) dirbackup=/save/$backupdate mkdir $dirbackup for server in /home/* do echo $server"test" tar -cjf $dirbackup$server.tar.zip $server done exit