can someone help me to create a short script that tar.gz all folders form a specific folder and the delete the folders themself (without deleting the tar.gz created files)?
Moreover I'd like to add it on crontab and run it each day.
For example: in /tmp I have:
I'd like to tar.gz test1 test2 test3 test4 and then delete the folder (not the new testX.tar.gz).
Compression can be also done according to specific folder month.
Last edited by vbe; 12-24-2014 at 07:03 AM..
Reason: code tags please for your code and data...
Hi, I would like to know how to go about writing a script to compress & deleate old files from /var/mqm/log file system.
I am a complete beginner and would love it if someone could actually give me the code for this.
Thank you. (4 Replies)
Hi
Is there any comand where in which we can check the time stamp of the sub folder created in one main folder and delete all the other subfolder which have been created one week before the actual time (current time )
or even 15 days before the current time
Thanks in advance (1 Reply)
hi,
I've a folder structure like :
/home/project/LIBNAMEA/FILE1
/home/project/LIBNAMED/FILE2
/home/project/LIBNAMEC/FILE3
/home/project/LIBNAMED/FILE4
/home/project/LIBNAMEX/FILE5
(there is no relation in the letters after the project/ )
and i need to delete the files keeping... (5 Replies)
Hi all,
I amd new in UNIX programming. I have a query.
I need to delete some files (like .dec files) from some folders. I have a list of folders. What will be command for it.
Please help me.
Thanks in Advance. (3 Replies)
Dear all,
i use incremental backup my data with .zip to my hard drive. what i need is i don't want the old .zip file older than 30 days. how to write a shell script automatically remove my external hard disc zip backup folders older than 30 days?
Regards, (2 Replies)
Hi all,
Someone please help with a script that will compress a directory for backed up:
home/main/directory2Bcompressed/
home/main/directory2Bcompressed_date.zip
Then all the files in the directory are to be deleted right afterwards, emptied out for new files to come in:
... (6 Replies)
Hi All,
I need a solution for the following scenario.
I am the owner for the particular folder and I have given 777 permissions for some specific reasons. So others can able to create folders and files.
But when I am done with the work, I need to delete the folders which are created by... (4 Replies)
I have an amount of folders and I want to delete only the empty ones. But I have more than 200 empty folders, so I would preffer do not delete one by one... I know it is possible, but I don't know how. I've tried with the size, using 'du' command, and saving the result in a file. After that, I made... (3 Replies)
hello everyone.
in /opt/abc every night there is a new folder created. in that folder there is aseries of files created for that day.
i would like to run a script every Sunday night at 02:00 to compress each file separately (preserving its name) who is older than 2 days.
i have found this... (2 Replies)
Hello Guys,
Can you please help me with a script which zips the older log files(1-2 weeks) and delete them?
I want to run the script manually instead of setting it up in a cron job.
Appreciate your help.
Regards,
Kris (6 Replies)