Sponsored Content
Top Forums Shell Programming and Scripting Using awk to get the maximum of a value in two different ranges Post 303003000 by ksennin on Wednesday 6th of September 2017 11:58:55 AM
Old 09-06-2017
Many thanks, it works perfectly!!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to print mon and max values of ranges

HI all I'm trying to write an awk script to print the min and max value in a range(s) contained in another file - the range values are in $2 EG 114,7964,1,y,y,n 114,7965,1,y,y,n 114,7966,1,y,y,n 114,7967,1,y,y,n 114,7969,1,y,y,n 114,7970,1,y,y,n 114,7971,1,y,y,n 114,7972,1,y,y,n... (3 Replies)
Discussion started by: Mudshark
3 Replies

2. UNIX for Dummies Questions & Answers

Awk ranges for selecting numbers

Hi, I am trying to use AWK to do some editing and formating of large tables of numbers and I am having trouble getting it to work. For brevities sake, I won't show the whole table, but I have a sample set of code: und$ awk '{($2+0) > 50;print $1}' temp 2000 147 2008 128 2002 100 1999 47... (2 Replies)
Discussion started by: ikerrin1@gmail.
2 Replies

3. Shell Programming and Scripting

Create ranges on a file with awk

Hello all, Let's say we have this file : $ cat inputfile 2 3 4 7 8 11 15 16 17 I'm trying to make a script with awk which gives as output the following : (4 Replies)
Discussion started by: rany1
4 Replies

4. Shell Programming and Scripting

Saving ranges using awk

Hi All, Is there a way to save a range in variable for later printing? for example write somthing like this: awk ' /pattern1/,/pattern2/{f=range} /pattern3/{print f} ' I don't know excatly what "range" could be but is there a way to do this? (8 Replies)
Discussion started by: ghoda2_10
8 Replies

5. Shell Programming and Scripting

Print minimum and maximum values using awk

Can I print the minimum and maximum values of values in first 4 columns ? input 3038669 3038743 3037800 3038400 m101c 3218627 3218709 3217600 3219800 m290 ............. output 3037800 3038743 m101c 3217600 3219800 m290 (2 Replies)
Discussion started by: quincyjones
2 Replies

6. Answers to Frequently Asked Questions

Finding maximum occurrence value using awk

Hi everyone, I'm a new member at the forum I have a file like this: field 2 values are either 0 or negative. file test4: 100815 -20 118125 0 143616 0 154488 0 154488 0 154488 -6 196492 -5 196492 -9 196492 -7 27332 0 29397 0 I would like to print a... (1 Reply)
Discussion started by: meet77
1 Replies

7. UNIX for Dummies Questions & Answers

Finding maximum occurrence value using awk

Hi everyone, I'm a new member at the forum I mistakenly posted this elsewhere too. I have a file like this: field 2 values are either 0 or negative. file test4: 100815 -20 118125 0 143616 0 154488 0 154488 0 154488 -6 196492 -5 196492 -9 196492 -7 27332 0... (5 Replies)
Discussion started by: meet77
5 Replies

8. Shell Programming and Scripting

Extract minimum/maximum using awk

From the below table I want to print highest value and lowest value using awk script. aaa 55 66 96 77 ggg 22 96 77 23 ddd 74 58 18 3 kkk 45 89 47 92 zzz 34 58 89 92 Thanks, Green edit by bakunin: it sure is not news to you that you should use CODE-tags, no? And that we do not want such... (3 Replies)
Discussion started by: gwgreen1
3 Replies

9. UNIX for Dummies Questions & Answers

Using awk to find and use the maximum value in column of data

Dear Unix Gurus, I have a text file with multiple columns, for example, see sample.txt below 0 1 301 1 4 250 2 6 140 3 2 610 7 1 180I want to find the maximum in, say, column 3, normalise all the values to this maximum value (to 4 decimal places) and spit everything into a new... (2 Replies)
Discussion started by: tintin72
2 Replies

10. Shell Programming and Scripting

awk working inside specific pattern ranges

Hi, I have a text file, which I am trying to parse. File contents: BEG Id Job1 Id Stage1 1 EN Id Job2 Id Stage2 BEG Id2 Job3 Id Stage4 2 EN I have to process the data in this between every BEG and EN. so I am trying to restrict the range and inside every... (1 Reply)
Discussion started by: Kulasekar
1 Replies
DSYNC(1)							      Dovecot								  DSYNC(1)

NAME
dsync - Dovecot's mailbox synchronization utility SYNOPSIS
dsync [options] mirror location2 dsync [options] backup location2 DESCRIPTION
dsync is Dovecot's mailbox synchronization utility. It can be used for several different use cases: Two-way synchronization of mailboxes in different servers (via ssh(1)), creating backups of mails to a remote server, and convert mailboxes from/to different mailbox formats. The syncing is done as perfectly as possible: an IMAP or a POP3 client shouldn't be able to notice any differences between the two mail- boxes. Two-way syncing means that it's safe to do any kind of modifications in both sides, and dsync will merge the changes without losing any changes done on either side. This is possible because dsync can access Dovecot's index logs that keep track of changes. It's of course possible to have conflicts during merging, these are resolved in a safe way. See the dsync design document for more information. dsync uses the same configuration files as the rest of Dovecot (via doveconf binary). The entire configuration can be changed by giving -c parameter to another configuration file, or using -o parameter to override specific settings. When executing a remote dsync program it works the same way: it uses its own local configuration. dsync can be run completely standalone. It doesn't require any Dovecot server processes to be running, except when using -u parameter to do a userdb lookup from auth process. dsync can currently sync only one user at a time. If you want to dsync all users, you'll need to get a list of all users and execute dsync separately for each one. Any errors are written to stderr. OPTIONS
dsync recognizes the following command line options: -c config-file read configuration from the given config-file. By default /etc/dovecot/dovecot.conf will be used. -C alt_char Specifies an alter- native mailbox name character. If source and destination mailbox formats are different, it's possible that on one side there exists a mailbox name that isn't valid for the other side. These invalid mailbox names are fixed by replacing such invalid characters with the given alt_char. The default is '_'. -D Activates debug messages and makes dsync more verbose. -f Makes dsync run in "full sync" mode rather than "fast sync" mode. In fast sync mode dsync might skip syncing a mailbox, if both locations had modified it equally many times (i.e. highest-modseqs were equal), but with different changes. -k Preserve the existing environment variables, useful when using dsync with the SSH agent. -m mailbox Specifies the mailbox that should be synchronized or from which mails should be converted. The default is to synchronize all respectively convert from all mailboxes. -o setting=value Overrides the configuration setting from /etc/dovecot/dovecot.conf and from the userdb with the given value. In order to override multiple settings, the -o option may be specified multiple times. -R Reverse backup direction, so mails in location2 are backed up to default mail location. -u user Specifies that the userdb lookup for the given user should be done and used to set up the environment (uid, gid, home, etc.). By default the system user's current environment will be used. -v Makes dsync more verbose. ARGUMENTS
location2 The first mail location is based on configuration (mail_location or userdb settings). It's also possible to override it by giving -o mail_location=mail_location setting. This parameter defines the other mail location that is used. If the location is on local filesystem, you can use a regular mail_location, such as maildir:/backup/user/Maildir If the location is on a remote server, dsync can ssh to it by giving host or user@host as the parameter. If user is specified, it's given as -u parameter to dsync, not to ssh. The ssh username is always the default. The final way to specify a location is to give a full command line or a path to a script that executes the dsync. For example: ssh mailuser@host dsync -u user COMMANDS
dsync provides the following commands: mirror Does a two-way synchronization between two mail locations. Changes in both locations are synchronized to the other one, without losing any changes made by either of them. Any potential UID conflicts are resolved by giving them new UIDs. backup Backup mails from default mail location to location2 (or vice versa, if -R parameter is given). No changes are ever done to the source location. Any changes done in destination are discarded. EXIT STATUS
dsync will exit with one of the following values: 0 Synchronization was done perfectly. 2 Synchronization was done without errors, but some changes couldn't be done, so the mailboxes aren't perfectly synchronized. Running dsync again usually fixes this. Typically this occurs for message modification sequences with newly created mailboxes. It can also occur if one of the mailboxes change during the syncing. 1, >2 Synchronization failed. EXAMPLE
MIRRORING Mirror mailboxes to a remote server. Any errors are written to stderr. dsync -u username mirror username@example.com If you need more complex parameters to ssh, you can use e.g.: dsync -u username mirror ssh -i id_dsa.dovecot mailuser@example.com dsync -u username CONVERTING Assuming that the mail_location setting in /etc/dovecot/conf.d/10-mail.conf is set to: mail_location = mdbox:~/mdbox, a logged in system user may convert her/his mails from its Maildir in her/his home directory to the mdbox mailbox format. The user has to execute the com- mand: dsync mirror maildir:~/Maildir If you want to do this without any downtime, you can do the conversion one user at a time. Initially: o Configuration uses mail_location = maildir:~/Maildir o Set up the possibility of doing per-user mail location using userdb extra fields. Then for each user: 1. Run dsync mirror once to do the initial conversion. 2. Run dsync mirror again, because the initial conversion could have taken a while and new changes could have occurred during it. This second time only applies changes, so it should be fast. 3. Update mail extra field in userdb to mdbox:~/mdbox. If you're using auth cache, you need to flush it. 4. Wait for a few seconds and then kill the user's all existing imap and pop3 sessions (that are still using maildir). 5. Run dsync mirror once more to apply final changes that were possibly done. After this there should be no changes to Maildir, because the user's mail location has been changed and all existing processes using it have been killed. Once all users have been converted, you can set the default mail_location to mdbox and remove the per-user mail locations from userdb. REPORTING BUGS
Report bugs, including doveconf -n output, to the Dovecot Mailing List <dovecot@dovecot.org>. Information about reporting bugs is avail- able at: http://dovecot.org/bugreport.html SEE ALSO
doveadm(1), doveadm-kick(1), doveconf(1), dovecot(1) Additional resources: dsync design http://wiki2.dovecot.org/Design/Dsync Dovecot v2.1 2011-01-16 DSYNC(1)
All times are GMT -4. The time now is 11:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy