Hi all. New to unix and need a little help. I am trying to create a script to archive files or directories in to a tarball. I've played a little with scripts but dont understand how to do options. What i want to be able to do is give the command any number of inputs and an output.
ex.... (2 Replies)
Im trying to create a script to archive specified directories into a specified tarball backup file. This is what i want the input to look like
ex. save -i '/bin/b*' -i '/bin/ls' -o backup
this is what i have
#!/bin/bash
#save - backup file script
unset myInput
unset myOutput
while... (3 Replies)
Hi,
I want to archive more than 15 days old files from /var/spool/ directory which contains 67 folders.
I have done a script for a single folder which is as follows :
cd /data1/ctron80/var/spool/bmaprt/
find . -mtime +15 | awk '{print "mv " $1 " /back/spool/bmaprt"}' | sh
cd /back/spool/... (1 Reply)
Hello All,
I have developed a script which takes following parameter from the input file to archive log files
1)Input Path
2)File pattern(*.csv)
3)Number of days(+1)
Following is the algorithm of my script
Read the input file
go to that path and search for particular n days older... (3 Replies)
OS : RedHat Linux 6.2
Shell : Bash
Our application write messages, warnings,..etc to the following log file .
/app/cms/diagnostics/logs/cms_messages.log
This file has become huge now. I want this file to be archived on monthly basis using a small shell script.
ie. On the 1st day of... (1 Reply)
Hi,
I have a log file that gets updated every second. Currently the size has grown to 20+ GB. I need to have a command/script, that will try to get the actual size of the file and will remove 50% of the data that are in the log file. I don't mind removing the data as the size has grown to huge... (8 Replies)
Dear Team,
I am looking for transferring files to and from the local and remote servers using SFTP commands. Currently the script is using the mget and mput commands to do the copying of the files. While I am trying to move the files from local to remote server, I would also like to archive... (21 Replies)
Hi Team -
I"m very new to Shell Scripting so I have a rather novice question. My forte is Windows Batch Scripting so I was just wondering what the Shell Script equivalent is to the DOS command %~n?
%~n is a DOS variable that dispayed the script name.
For instance (in DOS):
REM... (11 Replies)
Hi,
I am totally a newbie to any programming languages and I just started an entry level job in an IT company. One of my recent tasks is to create a script that is able to show the log file of linux service (i.e. ntpd service)
lets say, if I run my script ./test.sh, the output should be... (3 Replies)