help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] Fetch emails from a remote host


From: thorsopia
Subject: [Help-bash] Fetch emails from a remote host
Date: Wed, 3 Oct 2012 16:30:13 -0400 (EDT)
User-agent: SquirrelMail/1.4.13

Hi,

I'm writing a script that should copy new emails from a remote host.

I'd like to check the following before running rsync:

 - Are there any files in the Maildir of the server?
 - Are there any differences between server's Maildir and client's Maildir?

I'd like to copy the new files to the client and check that everything
went fine (something like sha1sum or cmp but for dirs*).

Then I'll remove all files in the Maildir of the server:

 $ ssh address@hidden "rm /home/user/Maildir/new/*"

(I haven't tried this one, but it should work.)

I've already found some commands that might be useful, but it's not
enough:

 $ ssh address@hidden "find /home/user/Maildir/new -type f -empty"

 $ rsync -avzu -e ssh address@hidden:/home/user/Maildir/new \
 > /home/user/Maildir/new

Could you help me to glue these parts together?

Thanks

* There is a command called dircmp, but I haven't found it in the
repository of my distro.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]