I have the following bash script:
#!/bin/bash set -e cd /var/www/html/mydir tar cvf backup.tar file1.php file2.php ... mysqldump -u$1 -p$2 $3 mytable > sqlbackup.sql tar xvf mypatch.tar mysql -u$1 -p$2 $3 < mysqlpatchfromthetarpatch.sql echo 'Success.'
Angry edit: I don't understand the downvote. In case that guy can't read a post from start to finish, i want to just extract some files, not run them. Here's the error:
[root@webserver]# ./myscript.sh user "password" dbname file1.php : No such file or directorycle.php: line 1: ?php include/DatabaseObject/Article.php: line 2: class: command not found
file1.php is called include/Controllers/AdminController.php and the next file is called include/DatabaseObject/Article.php, i'm assuming that's why i got
: No such file or directory*cle.php*: line 1: ?php
After extracting my files, it breaks on an error that's inside file1.php. What can I do?