Sponsored Content
Top Forums Shell Programming and Scripting Newbie Question - Help with script Post 302413522 by jamba1 on Friday 16th of April 2010 03:44:43 AM
Old 04-16-2010
Newbie Question - Help with script

Hi

I have about 5000 expired images that need removed from disk. Instead of doing it manually I am trying to use the following script:

Code:
 
#vi remove_expired_images
FilePath=/Scripts
for i in `cat $FilePath/backupid.txt`
do
#echo $i >> $FilePath/Jim.txt
/opt/openv/netbackup/bin/admincmd/bpexpdate -backupid  $i -d 0 1>> $FilePath/change.log 2>> $FilePath/change.log
done

run manually


Code:
# /opt/openv/netbackup/bin/admincmd/bpexpdate -backupid sealydb1_1268616505 -d 0
Are you SURE you want to delete sealydb1_1268616505 y/n (n)?

How do I include a line in the script to answer y to each image that needs removed?
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Newbie Question

I am fairly new to *nix/linux and I have just installed SuSe 8.2. I am wondering what skills would be good to learn. I know that I will need to learn how to write scripts, but what scripting languages should I learn. I greatly appreciate any and all comments. ... (5 Replies)
Discussion started by: Ntalektual
5 Replies

2. Shell Programming and Scripting

Newbie question

Hello, I have text file while looks this test1 test2 test3 test4 test5 test6 and if I want to parse it and make new file which would like this test1 test2 test3 test4 test5 test6 How can I do this in korn shell script Thanks (9 Replies)
Discussion started by: peeyush_23
9 Replies

3. Shell Programming and Scripting

Newbie Question: passing a variable into java from script?

I'm currently working on my second ever ksh script! So I apologize if this is a stupid question - I've searched the forum and on google and haven't seen anything :confused: I'm running my script with an input at startup that variable determines a couple of other values(int) that I store into... (1 Reply)
Discussion started by: Cailet
1 Replies

4. UNIX for Dummies Questions & Answers

Newbie question?

What is the best way to learn UNIX on the web, with out buying books? any link would be much help. Thank you in advance, L (1 Reply)
Discussion started by: lsoria1
1 Replies

5. Programming

Newbie question

Dear all, I have a question related to parallel programing and if you can give me some hints on how to deal with it, it would be really great. I would like to run a small application on a supercompter of 128 CPUs. Unfortunately, on this machine only jobs which require 32 CPUs are allowed to... (1 Reply)
Discussion started by: Eduard
1 Replies

6. UNIX for Dummies Questions & Answers

UNIX newbie NEWBIE question!

Hello everyone, Just started UNIX today! In our school we use solaris. I just want to know how do I setup Solaris 10 not the GUI one, the one where you have to type the commands like ECHO, ls, pwd, etc... I have windows xp and I also have vmware. I hope I am not missing anything! :p (4 Replies)
Discussion started by: Hanamachi
4 Replies

7. Shell Programming and Scripting

perl newbie . &&..programming newbie (question 2)

Hello everyone, I am having to do a lot of perl scripting these days and I am learning a lot. I have this problem I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files.. there is folder1\folder2\*.gz and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies

8. Shell Programming and Scripting

Newbie Question: Killing a process using a supplied name to a shell script

Hi, I am trying to automate the killing of named processes of which I found a good solution here on the forums but as I am pretty much a begginer to linux I am having an issue. The code I found is: kill $(ps -ef | nawk '/monitoreo start/ { print $2}'} but what I want to do is replace... (3 Replies)
Discussion started by: TylrRssl1
3 Replies

9. Programming

need help with shell script filtering files and sort! newbie question?

Hi folks, I would like to get familiar with shell script programing. The first task is: write a shell script that: scans your home-folder + sub-directory for all txt-files that all users of your group are allowed to read and write then output these files sorted by date of last... (4 Replies)
Discussion started by: rollinator
4 Replies

10. Shell Programming and Scripting

What does this do (newbie question)...

I was looking through some code online and came accross this... ls *.txt | grep text1 | cat file1 – file2 | `echo wc –l` I know what "ls|grep text1" does and I know a word count gets echoed but beyond that I am confused. Please use layman terms as much as possible as I am a newbie. (8 Replies)
Discussion started by: elohssa
8 Replies
zipios::DirectoryCollection(3)				     Library Functions Manual				    zipios::DirectoryCollection(3)

NAME
zipios::DirectoryCollection - SYNOPSIS
#include <dircoll.h> Inherits zipios::FileCollection. Public Member Functions DirectoryCollection () Default Constructor. DirectoryCollection (const string &path, bool recursive=true, bool load_now=false) Constructor. virtual void close () Closes the FileCollection. virtual ConstEntries entries () const virtual ConstEntryPointer getEntry (const string &name, MatchPath matchpath=MATCH) const virtual istream * getInputStream (const ConstEntryPointer &entry) virtual istream * getInputStream (const string &entry_name, MatchPath matchpath=MATCH) Returns a pointer to an opened istream for the specified entry name. virtual int size () const Returns the number of entries in the FileCollection. virtual FileCollection * clone () const Create a heap allocated clone of the object this method is called for. virtual ~DirectoryCollection () Destructor. Protected Member Functions void loadEntries () const void load (bool recursive, const FilePath &subdir=FilePath()) Protected Attributes bool _entries_loaded bool _recursive FilePath _filepath Detailed Description DirectoryCollection is a FileCollection that obtains its entries from a directory. Definition at line 19 of file dircoll.h. Constructor &; Destructor Documentation zipios::DirectoryCollection::DirectoryCollection () [inline, explicit] Default Constructor. Definition at line 23 of file dircoll.h. zipios::DirectoryCollection::DirectoryCollection (const string &path, boolrecursive = true, boolload_now = false) [explicit] Constructor. Parameters: path A directory path name. If the name is not a valid directory the created DirectoryCollection will be invalid. load_now Load directory into memory now. Otherwise it will be done when it is first needed. Definition at line 20 of file dircoll.cpp. zipios::DirectoryCollection::~DirectoryCollection () [virtual] Destructor. Definition at line 118 of file dircoll.cpp. Member Function Documentation FileCollection * zipios::DirectoryCollection::clone () const [virtual] Create a heap allocated clone of the object this method is called for. The caller is responsible for deallocating the clone when he is done with it. Returns: A heap allocated copy of the object this method is called for. Implements zipios::FileCollection. Definition at line 114 of file dircoll.cpp. void zipios::DirectoryCollection::close () [virtual] Closes the FileCollection. Implements zipios::FileCollection. Definition at line 33 of file dircoll.cpp. ConstEntries zipios::DirectoryCollection::entries () const [virtual] Returns a vector of const pointers to the entries in the FileCollection. Returns: a ConstEntries containing the entries of the FileCollection. Exceptions: InvalidStateException Thrown if the collection is invalid. Reimplemented from zipios::FileCollection. Definition at line 38 of file dircoll.cpp. ConstEntryPointer zipios::DirectoryCollection::getEntry (const string &name, MatchPathmatchpath = MATCH) const [virtual] Returns a ConstEntryPointer to a FileEntry object for the entry with the specified name. To ignore the path part of the filename in search of a match, specify FileCollection::IGNORE as the second argument. Parameters: name A string containing the name of the entry to get. matchpath Speficy MATCH, if the path should match as well, specify IGNORE, if the path should be ignored. Returns: A ConstEntryPointer to the found entry. The returned pointer equals zero if no entry is found. Exceptions: InvalidStateException Thrown if the collection is invalid. Reimplemented from zipios::FileCollection. Definition at line 49 of file dircoll.cpp. istream * zipios::DirectoryCollection::getInputStream (const ConstEntryPointer &entry) [virtual] Returns a pointer to an opened istream for the specified FileEntry. It is the callers responsibility to delete the stream when he is done with it. Returns 0, if there is no such FileEntry in the FileCollection. Parameters: entry A ConstEntryPointer to the FileEntry to get an istream to. Returns: an open istream for the specified entry. The istream is allocated on heap and it is the users responsibility to delete it when he is done with it. Exceptions: InvalidStateException Thrown if the collection is invalid. Implements zipios::FileCollection. Definition at line 68 of file dircoll.cpp. istream * zipios::DirectoryCollection::getInputStream (const string &entry_name, MatchPathmatchpath = MATCH) [virtual] Returns a pointer to an opened istream for the specified entry name. It is the callers responsibility to delete the stream when he is done with it. Returns 0, if there is no entry with the specified name in the FileCollection. Parameters: matchpath Speficy MATCH, if the path should match as well, specify IGNORE, if the path should be ignored. Returns: an open istream for the specified entry. The istream is allocated on heap and it is the users responsibility to delete it when he is done with it. Exceptions: InvalidStateException Thrown if the collection is invalid. Implements zipios::FileCollection. Definition at line 76 of file dircoll.cpp. int zipios::DirectoryCollection::size () const [virtual] Returns the number of entries in the FileCollection. Returns: the number of entries in the FileCollection. Exceptions: InvalidStateException Thrown if the collection is invalid. Reimplemented from zipios::FileCollection. Definition at line 106 of file dircoll.cpp. Author Generated automatically by Doxygen for Zipios++ from the source code. Zipios++ Mon Oct 10 2011 zipios::DirectoryCollection(3)
All times are GMT -4. The time now is 01:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy