Script to move files and Creation of folder structure
We are receiving few zipped files in one location say : apple/oranges/incoming
All .zip files are placed here in incoming folder.
So few of the files are password encrypted.
There are only 10 zipped files, so we are planning to create a script which will pick that zip file from incoming location and place the files in orange/ongoing.
Before placing the zip files in Ongoing we need to create folders such as 101/801/SAW(we can hard code the folder structure) and then place the file in SAW.
To unzip the files we provide password and then remove the zipped file.
Here is the code I have tried:
Also there are other files which are not password encrypted they just need to be placed in ongoing, create the folder and unzipped.
Here is my environment:
As the password varies for each file I am trying to individual script for each file which is easy for us to setup the load.
We are receiving few zipped files in one location say : apple/oranges/incoming
All .zip files are placed here in incoming folder.
So few of the files are password encrypted.
There are only 10 zipped files, so we are planning to create a script which will pick that zip file from incoming location and place the files in orange/ongoing.
Before placing the zip files in Ongoing we need to create folders such as 101/801/SAW(we can hard code the folder structure) and then place the file in SAW.
To unzip the files we provide password and then remove the zipped file.
Here is the code I have tried:
Also there are other files which are not password encrypted they just need to be placed in ongoing, create the folder and unzipped.
Here is my environment:
As the password varies for each file I am trying to individual script for each file which is easy for us to setup the load.
First, you talk about creating a directory called SAW, yet in your code it is RAW. Second, you appear to be extracting the password from the filename. Is that correct? How do you know when a file is encrypted and when it is not?
There is so much wrong with the script as presented I don't know where to begin.
Using $() inappropriately
mkdir does not print anything do dir is empty
How do you know when a file is password protected? Your script appears to expect them all to be
Is the password in the filename?
You are not putting anything into the ongoing directory.
I'm assuming
is to set root to /apples/oranges/Incoming/sx15440101_ope, but the shell will expect sx15440101_ope to be an executable.
Similarly,
will result in a null value for the variable dir.
I don't know zip so I don't know what this is doing:
Are you trying to unzip the file or replace it with a decrypted version?
Hi Team,
I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder.
Eg:
parent folder --> /Interface/data/test/IN
Sub folder -->/Interface/data/test/IN/Invoice20180607233338
Subfolder will be always with timestamp... (6 Replies)
The below will move all the files in the directory dir to the destination using parallel and create a log, however will not keep them in the directory. I have tried mkdir -p but that does not seem to work or at least I can not seem to get it (as it deletes others files when I use it). What is the... (2 Replies)
Hello,
I need to move all the files inside /XYZ (has multi-depth sub directories) that are older than 14 days to/ABC directory but with retaining the SAME directory structure.
for example:
/XYZ/1/2/3/A/b.txt should be moved as /ABC/1/2/3/A/b.txt
I know about find /XYZ -type f -mtime +14... (3 Replies)
I want to move a folder with spaces from one folder to another.
I have two folders like this,
1).RT_032-222 -4444-01/ 2). RT_032-555 -7777-01/
I want to move files from 2 to 1 through shell script.Here I want to assign this like a user defined variable like as Source branch... (2 Replies)
Hi Team,
I have over 1 lakh pdf files.
I want to create folders like Disk-1, Disk-2 ..... & want to move 3000 pdfs per folder. Can i do it by script? Please help me.
Thanks & Regards
Parag Nehete (4 Replies)
I have in directory /media/AUDIO/WAVE many .mp3 files with names like:
my filename_01of02.mp3
my filename_02of02.mp3
Your File_01of06.mp3
Your File_02of06.mp3
etc....
In the same directory, /media/AUDIO/WAVE, I have many folders with names like
9780743579490
9780743579491
etc..
Inside... (7 Replies)
Hey, this might be a really basic question, but I'm new to Unix scripting.
I'm trying to find a command to replicate a file structure from one location to another & move the actual files contained in the base directories, i.e. I have this structure -
home/temp/test/dir1/ ... (3 Replies)
This is the file structure:
DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg
DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg
DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg
DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg
DESKTOP/Root of Photo... (4 Replies)
hi:
I have some files like this
folder1/recording1.mp3
folder1/docs/budget.doc
folder2/others/misc.mp3
folder3/others/notes.doc
all this folders and files are under the mp3 folder.
I would like to move just the mp3s to another folder but retain the subdir structure i have.
So if... (4 Replies)
Hi All,
I have a directory which has crores of files since from 2003 till now. I want to move only the 2003 files to another directory. Please help.
Thanks (2 Replies)