Im trying to write a script that will change user to cyrus then reconstruct mailbox for the user defined in the parsed argument. If i was loggin in to terminal to do this manually for wendys mailbox i would do this
That would reconstruct her mailboxes. Now i tried to do in a script using expect which i have never tried before heres my code
However this gives me the following errors
Quote:
changing to user cyrus
test.sh: line 14: spawn: command not found
couldn't read file "#": no such file or directory
test.sh: line 16: send: command not found
reconstructed mailbox wendysayers
finished
why is spawn not found? isnt it a unix command or something? What shall i do next?
My expect script is not stopping to accept stdin
puts "Hey dude, how old might you be?"
gets stdin Age
While running this the script does not wait for user response. What could be the problem?
Pls help (0 Replies)
I am having an issue with TCL\Expect; I am passing arguments via the commandline that are read in via "lrange $argv". One of those var's is a password with characters that need to be escapaed, after escaping them an hitting enter expect is placing curly braces around my password... why?!
... (4 Replies)
I have the following expect script sitting on a Linux box.
===
#!/usr/bin/expect -f
#
# backup.expect
#
# Expect script to backup a firewall via a SSH session
#
#
set firewall
set username
set password
set prompt
set filename
match_max 50000
spawn ssh -l... (2 Replies)
The big problem is that exp_internal isnt working... which makes it difficult to determine whats happening with the if statement.
1. why isnt exp_internal not working ?
2. Is there a better way to do the check of a file ?
Im trying to find a "tighter" way to check that a file exists and has... (0 Replies)
Hi All,
I am testing expect script in command prompt without issue, but in crontab it is not working, i check the output error as below:
#cat /var/log/testexp.log
spawn minicom -C /var/log/minicom1.log
No cursor motion capability (cm)
AT+COPS=?
I am new in scripting, together... (1 Reply)
Hi All,
I run the scp command in shell prompt without issue, but when on expect script as below:
#!/usr/bin/expect
spawn scp /var/spool/sms/failed.tar.gz abc@10.10.12.2:/home/abc
expect "abc@10.10.12.2's password: "
send "abcfef\r"
exit 0
It looks not working at all and the... (3 Replies)
I am trying to execute expect command inside by small bash script to login into servers using key authentication method. My script is as follows:
#!/bin/bash
HOST=$1
/usr/bin/expect -c "
spawn ssh -i /root/.ssh/id_rsa root@$HOST
expect -exact "Enter... (3 Replies)
Hi I am trying the following in my bash script which logs into my machine and runs a command. Trying to solve this using expect.
The first expect statement is hit and it enters the address "10.10.0.10" but when the second expect statement is hit it exits
#!/bin/bash
expect -c '
spawn... (2 Replies)
Discussion started by: skorada
2 Replies
LEARN ABOUT SUSE
reconstruct
RECONSTRUCT(8) System Manager's Manual RECONSTRUCT(8)
*
NAME
reconstruct - reconstruct mailboxes
SYNOPSIS
reconstruct [ -C config-file ] [ -p partition ] [ -x ] [ -r ] [ -f ]
[ -k ] [ -s ] [ -g ] [ -G ] mailbox...
reconstruct [ -C config-file ] -m
DESCRIPTION
Reconstruct rebuilds one or more IMAP mailboxes. When invoked with the -m switch, it rebuilds the master mailboxes file. It can be used
to recover from almost any sort of data corruption.
If Reconstruct can find existing header and index files, it attempts to preserve any data in them that is not derivable from the message
files themselves. The state reconstruct attempts to preserve includes the flag names, flag state, and internaldate. Reconstruct derives
all other information from the message files.
Reconstruct reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. Any mailbox directory under-
neath the path specified in the partition-news configuration option is assumed to be in news format.
Reconstruct does not adjust the quota usage recorded in any quota root files. After running reconstruct, it is advisable to run quota(8)
with the -f switch in order to fix the quota root files.
OPTIONS -C config-file
Read configuration options from config-file.
-p partition
Search for the listed (non-existant) mailboxes on the indicated partition. Create the mailboxes in the database in addition to
reconstructing them. (not compatible with the use of wildcards)
-x When processing a mailbox which is not in the mailbox list (e.g. via the -p or -f options), do not import the metadata from the
mailbox, instead create it anew (this specifically affects at least the mailbox's seen state unique identifier, user flags, and
ACL).
-r Recursively reconstruct all sub-mailboxes of the mailboxes or mailbox prefixes given as arguments.
-f Examine the filesystem underneath mailbox, adding all directories with a cyrus.header found there as new mailboxes. Useful for
restoring mailboxes from backups.
-k Preserve the cyrus.expunge file and the corresponding message files instead of deleting them.
-s Adds synchronization records to the log, so the synchronization service can replicate the changes.
-g Clear existing or regenerated GUIDs for all messages.
-G Force regeneration of GUIDs for all messages.
-m NOTE: CURRENTLY UNAVAILABLE
Rebuild the mailboxes file. Use whatever data in the existing mailboxes file it can scavenge, then scans all partitions listed in
the imapd.conf(5) file for additional mailboxes.
EXAMPLES
You want to reconstruct the index files for a user, you have recovered a deleted mail file from backup and given it a suitable name (eg
user/ben-lacy/33.), but it is not visible since it is not indexed:
reconstruct -r user.ben-lacy
If you have the unixhierarchysep:yes option set in /etc/imapd.conf you would need to run:
reconstruct -r user/ben.lacy
FILES
/etc/imapd.conf
CMU Project Cyrus RECONSTRUCT(8)