Hi Guys i'm looking for some help with creating a scripts:
Background - I run alot of testing which creates huge files. This fills up the diskspace over 3 weeks so needs constant deleting. but generally, I keep forgetting!!! so every 3 weeks it fails lol.
Basically i can't format the drive - permissions, key files on share e.t.c. I'm looking for some way to keep the folder structure on the share and remove all the files. The remove takes a long time so i want to somehow background it so i can continue while it removes:
a script to:
mount shares (currently 3)
create a 'container folder'
mv files from the existing folders to the 'container folder' under folder names (leaving existing folders present but empty)
remove the newly created container folder with all content as a background tasks
the leaves existing empty folders so i can carry on running while this deletes in the background
The first share has 6 folders with files inside it and the second has 5 folders with files. The 3rd folder has only files on the share. I tried just removing "test*" of the share but when the new testing begins some of its files are removed and therefore the tests fail.
The above will mean i can then run the script and when it confirms its started deleting i can begin my new testing on the empty folders
I'v drafted up a script but it looks stupidly long and silly and i know there must be a simpler way to do it!!!
Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted.
I've be... (5 Replies)
Hi
I need help in the script which looks at a contorl file which has a list of file names like xxxx.12345 and I want to take only xxxxx and search in a specific directory and remove the file if its older than 60 days
I have written something like this.. but seems to be wrong... (1 Reply)
I am working in directory week5 and I want to delete the files in directory week1, without leaving directory week5. I understand that rm is used to delete a file, but how do you remove them while working in a different directory. I also only want to delete a certain set of files *. (1 Reply)
Hi,
I have written a small shell script to remove the files olderthan X days (say 30). But I not sure how it acts on the filesystem, as I am using rm.
if
then
echo "##############################################"
echo "Invalid no .of arguments\n"
echo "Usage:\n$0 PATH... (6 Replies)
Hi Folks,
There is a job which generates a .zip files every day at /usr/app/generated directory , now please advise for the script that will delete this zip files permanently.but while deleting it should make sure that it will not delete the last two days recently generated zip files and this... (1 Reply)
Hi,
one of the server, log directory was never cleaned up. We have so many files. I want to remove all the files that starts with dfr* but I get error message when I use the *.
rm qfr*
bash: /usr/bin/rm: Arg list too long
I am trying to write this script but not working.
... (4 Replies)
HI,
I want to remove my backup files keeping last 30 days.
Now i am doing it manually.
Does anyone have a script to automate this process?
Thanks in advance (5 Replies)