Page 1 of 1

"CP" - Copy funktioniert nicht

Posted: 2007-11-03 13:16
by hendricius
Habe mir ein shell-script gemacht um meine Ordner automatisch via crontab sichern zu können. Leider funktioniert der Befehel cp nicht so wie ich es will. Habe schon viel ausprobiert. Die Error-message:
cp: target `/mnt/sdb/folderbackup/apache/r' is not a directory
cp: target `/bkp/folder/apache/r' is not a directory
cp: target `/mnt/sdb/folderbackup/teamspeak/r' is not a directory
cp: target `/bkp/folder/teamspeak/r' is not a directory
cp: cannot create regular file `/bkp/files/php.inir': No such file or directory
cp: cannot create regular file `/bkp/files/httpd.confr': No such file or directory
cp: cannot create regular file `/bkp/files/httpd_vhosts.confr': No such file or directory

Mein Shellscript

Code: Select all

cp -Rf /srv/www/htdocs/* /mnt/sdb/folderbackup/apache/
cp -Rf /srv/www/htdocs/* /bkp/folder/apache/
cp -Rf /home/teamspeak/* /mnt/sdb/folderbackup/teamspeak/
cp -Rf /home/teamspeak/* /bkp/folder/teamspeak/
cp -Rf /usr/local/Zend/etc/php.ini /bkp/files/php.ini
cp -Rf /usr/local/Zend/etc/php.ini /mnt/sdb/files/php.ini
cp -Rf /etc/apache2/httpd.conf /bkp/files/httpd.conf
cp -Rf /etc/apache2/httpd.conf /mnt/sdb/files/httpd.conf
cp -Rf /etc/apache2/extra/httpd-vhosts.conf /bkp/files/httpd_vhosts.conf
cp -Rf /etc/apache2/extra/httpd-vhosts.conf /mnt/sdb/files/httpd_vhosts.conf
Ist meine Syntax falsch? Habe schon mehrmals die Zielordner gelöscht und wiederhergestellt. Leider ohne Erfolg :/. Habt ihr eventuell eine bessere Lösung?[/code]

Danke.

Re: "CP" - Copy funktioniert nicht

Posted: 2007-11-03 13:22
by Joe User
Wenn man auf Win Shellscripte für *NIX erstellt, will man sie vor dem ersten Ausführen mit dos2unix behandeln.

Re: "CP" - Copy funktioniert nicht

Posted: 2007-11-03 13:37
by hendricius
Habe mir jetzt mal dos2unix gedownloaded. Aber kriege nur Errors.

Aber danke für den Tipp :-).

Habe jetzt das File direkt auf dem server erstellt:

Code: Select all

touch backup.sh
nano backup.sh
Danke