Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello, I\'m supposed to create a simple script to backup onto a network using ta

ID: 3629090 • Letter: H

Question

Hello, I'm supposed to create a simple script to backup onto a network using tar and scp -r command as well as the ~.bashrc to designate commands as a part of bash. I am having trouble making mine work. I would like to ask for input as to what I may be doing wrong. Here it is:

!/bin/bash
#
# Directory to back up
backup_dir="/home/directory/homeworkassign"

# Error-checking portion of script
if [ ! -d $backup_dir ]
then
echo "The specified backup directory $backup_dir does not exist."
echo "Operation canceled."
exit 1
fi

# Create filename for archive.
day=$(date +%Y%m%d)
hostname=$(athena.ecs.csus.edu -s)
archive_file="hostname-day$.tgz"

# Initiate backup sequence message
echo "Your folder is being backed up to $dest/$archive_file"

Any help would be be appreciated. Thanks!

Explanation / Answer

#!/bin/bash hostname=$(athena.ecs.csus.edu -s) to hostname="athena.ecs.csus.edu -s" archive_file="hostname-day$.tgz" ???????

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote