Quote:
Originally Posted by shivaa
Files and their permissions seem ok. But I don't know from where these command not found errors are coming.
I feel, it would be better if you can post whole script once (if something is confidential, then you can hide that and use dummy entry at that place).
|
I have set up 10 files in important_files directory and populated with jargon.
I have set up a config script with variables the user should be able to change.
I have a script which checks these variables to see if are present and correct (exist).
The script then should awk the lines from the confile.cfg and populate a backuplist.txt.
From this backup list the script should tar files into tarball and write to errorlog:
tar -czvf $BACKUP_FILE -T "$BACKUP_TARGETS" > "$LOGOUT" 2> "$LOGERR"
For some reason the script is reading the confile.cfg and trying to run each line as a command? - Is this normal, can I subdue this output or redirect it? and How would I do it?
Here seems to be the offending part:
. $CONFILE
+ . /home/ubuntu/confile.cfg
###############################################################
###############################################################
# CONFIGURATION FILE ASSIGNMENT 1 #
# Student: XXXXXXXXXXXXXXX #
###############################################################
# Please enter FULL directory of the files you need backed up after "=" below:
IMPORTANT_FILES_DIRECTORY=$HOME/assignment1/important_files
++ IMPORTANT_FILES_DIRECTORY=/root/assignment1/important_files
# Please enter FULL directory where you want the files be backed up to after "=" below:
BACKUP_FILES_DIRECTORY=$HOME/assignment1/backups
++ BACKUP_FILES_DIRECTORY=/root/assignment1/backups
# Please enter FULL directory where you want the backups to be restored to after "=" below:
RESTORE_FILES_DIRECTORY=$HOME/assignment1/restores
++ RESTORE_FILES_DIRECTORY=/root/assignment1/restores
# Please enter the Project Name to be assigned to the new backup file after "=" below:
PROJECT_NAME=ASSIGNMENT1
++ PROJECT_NAME=ASSIGNMENT1
# Please list the files or directories to be backed up on the next line, hit enter after each line:
/home/ubuntu/assignment1/important_files/file1
++ /home/ubuntu/assignment1/important_files/file1
/home/ubuntu/assignment1/important_files/file1: line 1: kjsdf: command not found
/home/ubuntu/assignment1/important_files/file1: line 2: asdfj: command not found
/home/ubuntu/assignment1/important_files/file1: line 3: asdfjasdf: command not found
/home/ubuntu/assignment1/important_files/file1: line 4: asdf: command not found
/home/ubuntu/assignment1/important_files/file1: line 5: asdf: command not found
/home/ubuntu/assignment1/important_files/file1: line 6: asdf: command not found
/home/ubuntu/assignment1/important_files/file1: line 7: bdrtwertewgrt: command not found
/home/ubuntu/assignment1/important_files/file1: line 8: gsbvwgtr: command not found
/home/ubuntu/assignment1/important_files/file1: line 9: bwetbtrw: command not found
/home/ubuntu/assignment1/important_files/file1: line 10: bwdfre: command not found
/home/ubuntu/assignment1/important_files/file2
++ /home/ubuntu/assignment1/important_files/file2
/home/ubuntu/assignment1/important_files/file2: line 1: rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr: command not found......................AND SO ON....