Internet Computer Mobile Games

Need help with a small shell script (bash)

Hello,


I am using a small shell script to download my website files. I am using wget to perform the operation, but I want to download the files into a folder that I will create using the mkdir command. I want this to be a complete automatic process in the sense that the shell script will create the folder, and then download to that folder. I am almost there, but not quite...


Code:

#!/bin/bash
mkdir "Website $(date +"%m-%d-%Y") Backup"
cd /public_html/cms/
wget -r -l 0 -nH --cut-dirs=1 'ftp://username:[email protected]/cms/' <<EOF
lcd "Website $(date +"%m-%d-%Y") Backup"
bye
EOF


The previous code will create the folder in the very first line, but then the wget downloads into the wget path (cms in the case of this sample code)


How can I update the code so it downloads into the path on the very first line of the code? mkdir "Website (date is here) Backup"


Thank you in advance, and Happy Belated Thanksgiving, Merry Christmas AND Happy New Year to all!
Brian

Top similar posts to Need help with a small shell script (bash)

Bash Shell Script Option Processing: Add -all and -q (quiet), Enforce No Repetition

I've writing a Bash script that takes N options. Call them -1, -2, ..., -N. The following applies to use of the options: Any number of the options may be provided, from 0 - N No options take any arguments The options may be provided in any order I process these in a rather standard way: while [[ $# -gt 0 ]] do OPTION="$1" case $OPTION in -1) process_option_1 shift ;; -2) process_option_2 shift ;; ... -N) process_option_N shift ;; *) echo "Unknown option $OPTION. Aborting.....

Bash : Shell script delete files matching all the passed arguments?

This is an assignment question, so I'm not directly looking for an answer or the script. So in one of my questions, I'm asked that I should delete the files containing any of the passed command line arguments. Here is the script snippet for that #!/bin/sh #some more stuff here for args in "[email protected]"; do if [ $# != 0 ]; then grep -l $args * | while read theFile; do if [ -f "$theFile" ] ; then rm "$theFile" echo "$theFile is deleted with $args match" else echo "$theFile not deleted" exit 2 ...

help with a bash or shell script

so for whatever reason my mddhfs pool seems to come "unavailable". I wanted to create a shell script that i could just run periodically via cron to: see if location is available - if so do nothing -- else run the following commands so i can "reconnect" the pool. sudo umount -l /storage have it enter my pw sudo mount -a Thanks for any help anyone can provide...

How to check day name is it saturday in bash shell script? on UNIX

How to check the day name,is it saturday in bash shell script. If dayname = saturday then run the full load else run just the incremental loads end if Thank you very much for the helpful information....

Can we write a script to run some command within each interactive bash shell process?

Is there a way to write a script which can go over all the interactive bash shell processes running on the same computer one by one, and run some command in each interactive bash shell respectively? (Assume only bash, no zsh etc. but if there are other kinds of shells such as zsh, then all the shells.) I would like to run some command in each shell respectively, because I would like to get some information about each shell process via the command, for example running dirs or jobs and collecting...

Unable to execute expect script from bash script AND from shell

Hello I have a simple expect script : Code: [[email protected] ~]# ls -lh /root/ | grep ht -rwxr--r--  1 root root  337 apr  4 17:04 htdigestexpect.exp Code: [[email protected] ~]# cat /root/htdigestexpect.exp #!/usr/bin/expect set myuser [lindex $argv 0] set mypass [lindex $argv 1] spawn /usr/bin/htdigest -c /etc/httpd/.$myuser "blabla" $myuser expect "New password:" send "$mypass\r" expect "Re-type new password:" send "$mypass\r" I...

Reproducing a P2P stream via mplayer in a bash shell script

My question is: It is possible to do what the title says? To be more precise I would like to run mplayer from within a bash shell script using a command such as mplayer http://someURL & where someURL contains a fixed pattern with a variable pattern embedded, to be passed to the script as a parameter. I have tried, but mplayer hangs while the same command written in the bash running in gnome-terminal works fine. So there are options to be supplied to mplayer's command line or simply this...

bash shell script command that takes a single input argument

shell script that takes a single input argument which represents a filename, and when executed, the script displays the following properties of the file in a user friendly output: filename, file type, file size in bytes, number of lines in file, date (but not time) when file was last modified....

Bash scripting: run a shell command from inside a script with variable inside quotes

I need to load a db into a mysql server and the following command works from the shell: From shell mysql -h "172.17.0.2" -u "root" "-pmypass" -Bse "create database mydb;" But not from the script, in which the ip and the password are variables passed as arguments: The script: set -x echo "Creating the database..." mysql -h $sqlip -u "root" -p$sqlpass -Bse "create database mydb;" The result of the script: Creating the database... + mysql -h 172.17.0.2 -u root -ppasswd -Bse 'create data...

how to encrypt a shell (bash) script?

shell script I want to encrypt. non-breaking encryption type please do not suggest SHC because it is breaking.I Want To Hide My Code....

syntax error: unexpected end of file shell script bash

#!/bin/bash # Consultamos la ocupación del dispositivo porcentajeOcupado=$(df -m | grep '/svpar01' | tr -s ' ' | cut -d ' ' -f 5 | tr -d %) ocupado=$(df -m | grep '/svpar01' | tr -s ' ' | cut -d ' ' -f 3 | tr -d %) disponible=$(df -m | grep '/svpar01' | tr -s ' ' | cut -d ' ' -f 4 | tr -d %) # Si la ocupación es igual o mayor al 80%... if [[ $porcentajeOcupado -ge 80 ]];then java -jar prueba-0.0.1-SNAPSHOT.jar "$ocupado" "$disponible" "$porcentajeOcupado" fi ...

Bash Shell Script Assignment

I need a shell script that will take (First Middle and Last Name, Phone #, and email address) as input. It's a group work, the group head information should be in blue color while the deputy information should display in red. There should be a selective menue that has options like press h for group head, d for deputy, m to add a group member, d to display results, e to exit....

Bash Shell Script Wildcard Nightmare

I'm working on a shell script for work that should allow me to find a directory based on a 5 or 6 digit number that a system of ours uses, and copy a file from within that directory. I'd do it manually, but I need to get 3000+ records from around 3TB of available data. Here's the problem I'm running into. Part of my script is using find, and when I go to run it, the script inserts a '\r' in front of the wildcard that I put in the script. I've tried escaping it with a \, quoting it, but nothing ...

what are the differences between #!/bin/bash in script to work under bash shell

what are the differences between #!/bin/bash in script to work under bash shell bash shell # bash # ps PID TTY TIME CMD 4935 pts/0 00:00:00 bash 4989 pts/0 00:00:00 bash 5025 pts/0 00:00:00 ps VS bash script #!/bin/bash ...

Commands work for high computing cluster on bash terminal but not in shell script

#$ -q neuro.q #$ -pe orte 5 #$ -1 mem_token=15G #$ -1 mem_free=15G cd /home/laneb/HPC_SCRIPTS/ module load MATLAB/R2016b dataset=" ‘ BL08_FLEX.mat’ " matlab -nodesktop -nosplash -r “CellSort($dataset);quit” ...

Design Apple Development Security Automobile Network Photography Health Money Travel Shopping Issues Operating systems Drivers Software Programming Tech Home Science Sport Solution