I have written the following script. It creates a new directory formatted like this Year,Month,Day. What it suppose to do is copy a file to the newly created directory, however I am new to this and the script makes the directory on the remote server, but copies the file to the directory not the subdirectory which is suppose to be the 2017-08-18, and so on. Please tell me what I need to do to get this to work.[root@hostname ~]# cat ontape.sh#!/bin/bash#sshpass -p 'PASSWORD' ssh root@hostname mkdir -p /home/mybackup/ontape/$(date +%Y-%m-%d)sshpass -p 'PASSWORD' ssh root@hostname mkdir -p /mybackup/ontape_tmp_backup/$(date +%Y-%m-%d)for server in $(cat servers.txt)do   sshpass -p 'PASSWORD' scp /dbbackup/backupdb/ontape/fullsize/* $serverdoneAlso, the /root/servers.txt file has the following code. [root@hostname ~]# cat servers.txtroot@hostname:/mybackup/ontape_tmp_backuproot@hostname:/home/mybackup/ontape
scp file to new directory
scripting;directory;scp