Sponsored Content
Top Forums Shell Programming and Scripting Opinions/Ideas/Suggestions needed Post 302279112 by pludi on Thursday 22nd of January 2009 02:20:32 AM
Old 01-22-2009
I probably should have been more clear, I'm sorry.

The cleaning itself isn't just a rm (that's done later, after the file has been in limbo for a specified time, and can be done as root), but include creating the target directory (if needed) and moving the file(s) there. Now in order to avoid having to call su/sudo for each and every file (and possibly creating a lot of unneeded syslog messages about the context switch) I'd like to change the user context for the whole loop.

Pseudo-Code to clarify:
Code:
loop over dirs to be cleaned
    switch user context if needed
    loop over find
        check if target exists
            otherwise create
        move file to target
        make a note of (attempted) move
    mail user the changes done and those failed
    switch back to original context

 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Runaway process. Opinions needed

not too long ago, i wrote a very short script that will bring up 4 customized xterms. The script went completely abnormal simply because of an error I had made in a while loop. This script took control of the system and rendered everything useless. The system admin team which i was part of... (4 Replies)
Discussion started by: TRUEST
4 Replies

2. UNIX for Advanced & Expert Users

Opinions on memory increase

We are trying to tune a server which phsycially is maxed out on cpu. We are maxing out on memory and swapping at a rate of 20-43% of our swap space which is approx 45% of total ram. We "can" upgrade to twice the memory that we currently have but it will be costly as there are no more seats... (5 Replies)
Discussion started by: MizzGail
5 Replies

3. Shell Programming and Scripting

help/suggestions needed with wget

Hi I'm thinking of using the following command to download some music from websites I visit (designated in the mp3blogs.txt file): wget -r -l1 -H -t1 -nd -N -np -A.mp3 -erobots=off -i ~/mp3blogs.txt -P ~/Music/WGet My only question is, is there ANY way to either download files that have... (0 Replies)
Discussion started by: gMan2020
0 Replies

4. Windows & DOS: Issues & Discussions

Backing up virtual machines - opinions/suggestions needed.

Hi, I was required to do a backup of a virtual machine that runs on vmware. The guest operating system is windows, and the host is windows too. I have to backup the whole directory of the virtual machine (say in linux it'll be in /var/lib/vmware/virtual machines/) to a linux server. Initially... (0 Replies)
Discussion started by: 60doses
0 Replies

5. Shell Programming and Scripting

Need opinions about scripting blackouts

Hi All. I am stuck and need some fresh ideas... I am writing a script that checks to see if an Oracle db is available. The script reads an ini file to determine if there is a blackout period for certain db's... ie: we don't care if it's up or down 1700 - 700 the next morning. The ini file... (3 Replies)
Discussion started by: jamie_collins
3 Replies

6. Shell Programming and Scripting

WPAR monitoring shell script suggestions needed

Hi All, This is for WPAR monitoring shell script, earlier opened thread was closed, had to open a new thread, as suggested I have used script as below, But am trying to get the output in below format, need suggestions with it. Below is the lswpar output, required output format. ... (7 Replies)
Discussion started by: aix_admin_007
7 Replies

7. Shell Programming and Scripting

Distributing script projects, suggestions/ideas?

Heyas If you recall, not too long ago, i was asking about the GNU Autotools. The feedback on that was almost unisense, and me figured that it turned my (back then) +98% SHELL project into a +73% GROFF project... :( Felt a bit overhelmed, specialy since i didnt actualy use or need the true... (0 Replies)
Discussion started by: sea
0 Replies
RCVSTORE(1)							     [nmh-1.5]							       RCVSTORE(1)

NAME
rcvstore - asynchronously incorporate mail into a folder SYNOPSIS
/usr/lib/mh/rcvstore [+folder] [-create | -nocreate] [-unseen | -nounseen] [-zero | -nozero] [-sequence name ...] [-public | -nopublic] [-version] [-help] DESCRIPTION
Rcvstore incorporates a message from the standard input into an nmh folder. This command is typically used in conjunction with mail fil- tering programs such as slocal and procmail, to filter your mail into different folders. You may specify which folder to use with +folder. If no folder is specified, rcvstore will use the folder given by a non-empty "Inbox:" entry in the user's profile, else it will use the folder named "inbox". If the switch -create is given (it is the default) and if the specified (or default) folder does not exist, then it will be created. You may disable this with the -nocreate option. In this case rcvstore will exit if the specified folder does not exist. When the new message is incorporated into the folder, it is assigned the next highest number for that folder. Rcvstore will incorporate anything except zero length messages into the user's nmh folder. It will not change the message in any way. If the user's profile contains a "Msg-Protect: nnn" entry, it will be used as the protection on the newly created message, otherwise the nmh default of 0644 will be used. For all subsequent operations on this message, this initially assigned protection will be preserved. If the switch -unseen is given (it is on by default), and if the profile entry "Unseen-Sequence" is present and non-empty, then rcvstore will add the newly incorporated message to each sequence named by this profile entry. You may use the switch -nounseen to disable this. These sequences will not be zero'ed by rcvstore prior to adding the new message. Furthermore, the incoming message may be added to additional sequences as they arrive by the use of the -sequence switch. As with the com- mands pick and mark, you may also use the switches -zero and -nozero to specify whether to zero old sequences or not. Similarly, use of the -public and -nopublic switches may be used to force these sequences to be public or private sequences. FILES
$HOME/.mh_profile The user profile PROFILE COMPONENTS
Path: To determine the user's nmh directory Folder-Protect: To set mode when creating a new folder Inbox: To find the default inbox Msg-Protect: To set mode when creating a new message Unseen-Sequence: To name sequences denoting unseen messages SEE ALSO
rcvdist(1), rcvpack(1), rcvtty(1), mh-sequence(5) DEFAULTS
`+folder' defaults to "Inbox" profile entry `-create' `-unseen' `-nozero' CONTEXT
No context changes will be attempted, with the exception of sequence manipulation. BUGS
If you use the "Unseen-Sequence" profile entry, rcvstore could try to update the context while another nmh process is also trying to do so. This can cause the context to become corrupted. To avoid this, do not use rcvstore if you use the "Unseen-Sequence" profile entry. MH.6.8 11 June 2012 RCVSTORE(1)
All times are GMT -4. The time now is 08:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy