Re: How to backup emails with colon in file name

2017-07-13 Thread Jason
On Mon, Jul 10, 2017 at 01:30:36PM -0500, Tim Chase wrote:
> On 2017-07-05 21:38, Jason wrote:
> > > - create a file such as "mail.img" on your FAT partition, format
> > > it as something smarter (e.g. ext{2,3,4}, UFS or ZFS), and mount
> > > it as a loop-back/memory-disk, to which you can then use rsync to
> > > that loopback device.  This allows for actual sym-links and
> > > hard-links which rsync can use for deduplication (using the
> > > --link-dest option[1])  
> >
> > An interesting suggestion but a little above my head, I fear.
> 
> The specifics would be OS-dependent, but the general gist would be
> something like the following:
> 
> 1) make a DOS-friendly-named "mail.img" file to act as a virtual disk.
> I'm specifying 100MB here, but choose a value appropriate for you
> 
>   $ MAILIMG=/mnt/fatusb/mail.img
>   $ MOUNTPOINT=/mnt/mailbackup/
>   $ mkdir -p ${MOUNTPOINT}
>   $ truncate -s 100MB ${MAILIMG}
> 
> 2) make a filesystem on it and get the system to recognize it as a
> device.  On Linux, that might looks something like:
> 
>   $ /sbin/mkfs.ext4 ${MAILIMG}
>   # DEVICE=/dev/loop0
>   # losetup ${DEVICE} disk.img
> 
> On FreeBSD for UFS, you'd create a memory disk and format it:
> 
>   $ su -
>   # MD_IDX=0
>   # mdconfig -f ${MAILIMG} -u ${MD_IDX}   # create md${MD_IDX}
>   # gpart create -s gpt md${MD_IDX}   # set up GPT partitioning
>   # gpart add -t freebsd-ufs md${MD_IDX}  # create a partition in that
>   # DEVICE=/dev/md${MD_IDX}p1
>   # newfs ${DEVICE}   # format it with UFS
> 
> 3) mount the loopback/memory-disk device someplace:
> 
>   # mount ${DEVICE} ${MOUNTPOINT}
> 
> 4) use the device mount-point for your backup, such as
> 
>   $ rsync -avr ~/Mail/ ${MOUNTPOINT}
> 
> 5) unmount it:
> 
>   # umount ${DEVICE}
> 
> 6) destroy the loopback device:
> 
>   On Linux:
>   # losetup -d ${DEVICE}
> 
>   On FreeBSD:
>   # mdconfig -d -u ${MD_IDX}
> 
> 
> Once you have the disk-image file, you can skip the
> partitioning/formatting commands (gpart/mkfs.ext4/newfs) and just
> create the device (losetup/mdconfig), mount, use, unmount, and
> destroy the device.  Linux's mount(1) even knows about loop-back
> devices so you can just create/mount in one step, and
> unmount/destroy in one step:
> 
>   # mount -o loop ${MAILIMG} ${MOUNTPOINT}
>   use the disk
>   # umount ${MOUNTPOINT}

Intriguing, I might need to try this sometime. Nice to know of this
option; it might come in useful someday.

> 
> There may be a simpler way of doing it on FreeBSD, but I just use the
> mdconfig/mount/use/umount/mdconfig-d sequence and it Works For Me(tm)
> 
> You might also be able to use some nice ZFS functionality if it was
> available, but that is a little more convoluted (importing/exporting
> pools in particular).
> 
> Sorry if that's more complicated/convoluted than you want, but it
> does give you "full Unix-like filesystem functionality on a
> DOS-formatted USB drive".
> 
> -tkc
> 
> 
Thanks!
-- 
Jason


Re: How to backup emails with colon in file name

2017-07-10 Thread Tim Chase
On 2017-07-05 21:38, Jason wrote:
> > - create a file such as "mail.img" on your FAT partition, format
> > it as something smarter (e.g. ext{2,3,4}, UFS or ZFS), and mount
> > it as a loop-back/memory-disk, to which you can then use rsync to
> > that loopback device.  This allows for actual sym-links and
> > hard-links which rsync can use for deduplication (using the
> > --link-dest option[1])  
>
> An interesting suggestion but a little above my head, I fear.

The specifics would be OS-dependent, but the general gist would be
something like the following:

1) make a DOS-friendly-named "mail.img" file to act as a virtual disk.
I'm specifying 100MB here, but choose a value appropriate for you

  $ MAILIMG=/mnt/fatusb/mail.img
  $ MOUNTPOINT=/mnt/mailbackup/
  $ mkdir -p ${MOUNTPOINT}
  $ truncate -s 100MB ${MAILIMG}

2) make a filesystem on it and get the system to recognize it as a
device.  On Linux, that might looks something like:

  $ /sbin/mkfs.ext4 ${MAILIMG}
  # DEVICE=/dev/loop0
  # losetup ${DEVICE} disk.img

On FreeBSD for UFS, you'd create a memory disk and format it:

  $ su -
  # MD_IDX=0
  # mdconfig -f ${MAILIMG} -u ${MD_IDX}   # create md${MD_IDX}
  # gpart create -s gpt md${MD_IDX}   # set up GPT partitioning
  # gpart add -t freebsd-ufs md${MD_IDX}  # create a partition in that
  # DEVICE=/dev/md${MD_IDX}p1
  # newfs ${DEVICE}   # format it with UFS

3) mount the loopback/memory-disk device someplace:

  # mount ${DEVICE} ${MOUNTPOINT}

4) use the device mount-point for your backup, such as

  $ rsync -avr ~/Mail/ ${MOUNTPOINT}

5) unmount it:

  # umount ${DEVICE}

6) destroy the loopback device:

  On Linux:
  # losetup -d ${DEVICE}

  On FreeBSD:
  # mdconfig -d -u ${MD_IDX}


Once you have the disk-image file, you can skip the
partitioning/formatting commands (gpart/mkfs.ext4/newfs) and just
create the device (losetup/mdconfig), mount, use, unmount, and
destroy the device.  Linux's mount(1) even knows about loop-back
devices so you can just create/mount in one step, and
unmount/destroy in one step:

  # mount -o loop ${MAILIMG} ${MOUNTPOINT}
  use the disk
  # umount ${MOUNTPOINT}

There may be a simpler way of doing it on FreeBSD, but I just use the
mdconfig/mount/use/umount/mdconfig-d sequence and it Works For Me(tm)

You might also be able to use some nice ZFS functionality if it was
available, but that is a little more convoluted (importing/exporting
pools in particular).

Sorry if that's more complicated/convoluted than you want, but it
does give you "full Unix-like filesystem functionality on a
DOS-formatted USB drive".

-tkc





Re: How to backup emails with colon in file name

2017-07-05 Thread Jason
On Sun, Jul 02, 2017 at 01:55:09PM -0500, Tim Chase wrote:
> On 2017-06-27 10:00, Jason wrote:
> > I use rsync for doing incremental backups to a USB stick. I am
> > having a problem that rsync does not like backing up my mutt emails
> > since they contain a colon in the filename. For example:
> > 
> > 1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S
> > 
> > Using fat32 format on the USB stick may be part of the problem but I
> > don't want to change to a different format for other reasons.
> > 
> > What is the best way to backup these emails or how do others handle
> > this?
> 
> A little late to this game, but a couple other ideas occur to me:
> 
> - back up to a .tar file (or maybe a .zip file?) instead of directly
>   to the file-system.  That way, a DOS-acceptable .tar (or .tgz)
>   filename exists in the FAT partition, while its contents contain
>   filenames containing colons.  This (to the best of my knowledge)
>   doesn't take advantage of any rsync linking/deduplication your
>   script may be doing
The only problem I have with this is that the way I run rsync, I
create backup copies of any modified file before overwriting and store
those in an archive folder until they are sufficiently old, then
delete. So if I create a .tar or .zip file it will basically move the
old copy and replace with the new copy on every backup, which,
given the size of the archive, takes too long to suit me, besides
eating up available storage too fast.

What I'm actually doing now is similar to what you suggested above,
but I'm creating and updating the zip file directly on the USB flash
drive using zip -FS. So I'm not using rsync for mails, only for
everything else. This seems to be working fine so far, only drawback
being there are no older copies being archived as everything in the
zip file gets synchronized to the filesystem, but that's okay for this
situation.

> 
> - create a file such as "mail.img" on your FAT partition, format it as
>   something smarter (e.g. ext{2,3,4}, UFS or ZFS), and mount it as a
>   loop-back/memory-disk, to which you can then use rsync to that
>   loopback device.  This allows for actual sym-links and hard-links
>   which rsync can use for deduplication (using the --link-dest
>   option[1])
An interesting suggestion but a little above my head, I fear.

> - reformat the USB drive as something smarter than FAT (whether
>   ext{2,3,4}, UFS, ZFS, or maybe NTFS?).  This does come with the
>   disadvantage of being harder to read on Windows (though I've seen
>   some Windows drivers that allow you to mount EXT2 partitions under
>   Windows) but would ameliorate all your other issues.  Given the
>   (un)reliability of USB drives, there's a lot to be said for
>   creating a ZFS pool out of the drive and setting copies=2 to give a
>   better chance at recovery 
> 
> -tkc
> 
> [1]
> http://web.archive.org/web/20120429040940/http://www.interlinked.org/tutorials/rsync_time_machine.html
> 
> 

Thanks for your and everyone else's input.
-- 
Jason


Re: How to backup emails with colon in file name

2017-07-02 Thread Tim Chase
On 2017-06-27 10:00, Jason wrote:
> I use rsync for doing incremental backups to a USB stick. I am
> having a problem that rsync does not like backing up my mutt emails
> since they contain a colon in the filename. For example:
> 
> 1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S
> 
> Using fat32 format on the USB stick may be part of the problem but I
> don't want to change to a different format for other reasons.
> 
> What is the best way to backup these emails or how do others handle
> this?

A little late to this game, but a couple other ideas occur to me:

- back up to a .tar file (or maybe a .zip file?) instead of directly
  to the file-system.  That way, a DOS-acceptable .tar (or .tgz)
  filename exists in the FAT partition, while its contents contain
  filenames containing colons.  This (to the best of my knowledge)
  doesn't take advantage of any rsync linking/deduplication your
  script may be doing

- create a file such as "mail.img" on your FAT partition, format it as
  something smarter (e.g. ext{2,3,4}, UFS or ZFS), and mount it as a
  loop-back/memory-disk, to which you can then use rsync to that
  loopback device.  This allows for actual sym-links and hard-links
  which rsync can use for deduplication (using the --link-dest
  option[1])

- reformat the USB drive as something smarter than FAT (whether
  ext{2,3,4}, UFS, ZFS, or maybe NTFS?).  This does come with the
  disadvantage of being harder to read on Windows (though I've seen
  some Windows drivers that allow you to mount EXT2 partitions under
  Windows) but would ameliorate all your other issues.  Given the
  (un)reliability of USB drives, there's a lot to be said for
  creating a ZFS pool out of the drive and setting copies=2 to give a
  better chance at recovery 

-tkc

[1]
http://web.archive.org/web/20120429040940/http://www.interlinked.org/tutorials/rsync_time_machine.html





Re: How to backup emails with colon in file name

2017-06-28 Thread Jason
On Wed, Jun 28, 2017 at 09:23:33AM -0400, Mark H. Wood wrote:
> On Tue, Jun 27, 2017 at 03:29:16PM -0500, Jason wrote:
> > I've been experimenting with tar. Let's say I decide to use tar and
> > forget about using rsync for mails, what would be some good options to 
> > use to only update the archive with new files? I have tried:
> > 
> > tar uGvf ~/Main/mail.tar /path/to/maildir
> > 
> > but it seems every time it is run it just adds copies of everything to
> > the archive again, instead of just what was added since last time.
> 
> Have you tried out 'zip -u'?

Thank you for that suggestion; it does almost what I want.
And 'zip -FS' suits my wishes even better - deletes any files from the
archive that no longer exist in the file system.

Thanks to everyone for your input!

> 
> -- 
> Mark H. Wood
> Lead Technology Analyst
> 
> University Library
> Indiana University - Purdue University Indianapolis
> 755 W. Michigan Street
> Indianapolis, IN 46202
> 317-274-0749
> www.ulib.iupui.edu



-- 
Jason


Re: How to backup emails with colon in file name

2017-06-28 Thread Mark H. Wood
On Tue, Jun 27, 2017 at 03:29:16PM -0500, Jason wrote:
> I've been experimenting with tar. Let's say I decide to use tar and
> forget about using rsync for mails, what would be some good options to 
> use to only update the archive with new files? I have tried:
> 
> tar uGvf ~/Main/mail.tar /path/to/maildir
> 
> but it seems every time it is run it just adds copies of everything to
> the archive again, instead of just what was added since last time.

Have you tried out 'zip -u'?

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu


signature.asc
Description: PGP signature


Re: How to backup emails with colon in file name

2017-06-27 Thread Matthias Apitz
El martes, 27 de junio de 2017 22:27:07 (CEST), Ian Zimmerman 
 escribió:

On 2017-06-27 21:05, Bastian wrote:


  c Don't use fat (sry, could not resist)


While we're at it, using a USB flash (I assume) stick for backups is
also not a great idea, independently of the file system on it.



Yes, some are write-only devices.

matthias



--
Sent from my Ubuntu phone
http://www.unixarea.de/


Re: How to backup emails with colon in file name

2017-06-27 Thread Rainer Sokoll

> Am 27.06.2017 um 17:00 schrieb Jason :
> 
> I use rsync for doing incremental backups to a USB stick. I am having
> a problem that rsync does not like backing up my mutt emails since
> they contain a colon in the filename. For example:
> 
> 1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S
> 
> Using fat32 format on the USB stick may be part of the problem but I
> don't want to change to a different format for other reasons.
> 
> What is the best way to backup these emails or how do others handle
> this?

If you really need FAT32, I'd suggest creating a container on the flash drive 
using dd, and then format that container with a file system capable of colons.
Then just mount the container (mount -o loop) and rsync into it.

Rainer


signature.asc
Description: Message signed with OpenPGP


Re: How to backup emails with colon in file name

2017-06-27 Thread Jason
On Tue, Jun 27, 2017 at 01:27:07PM -0700, Ian Zimmerman wrote:
> On 2017-06-27 21:05, Bastian wrote:
> 
> >   c Don't use fat (sry, could not resist)
> 
> While we're at it, using a USB flash (I assume) stick for backups is
> also not a great idea, independently of the file system on it.
That may be true, but they're cheap, and I try not to have them as my
only backup. (I have rarely had one fail without good reason.)
> 
> -- 
> Please *no* private Cc: on mailing lists and newsgroups
> Personal signed mail: please _encrypt_ and sign
> Don't clear-text sign:
> http://primate.net/~itz/blog/the-problem-with-gpg-signatures.html

-- 
Jason


Re: How to backup emails with colon in file name

2017-06-27 Thread Cameron Simpson

On 27Jun2017 10:00, Jason  wrote:

I use rsync for doing incremental backups to a USB stick. I am having
a problem that rsync does not like backing up my mutt emails since
they contain a colon in the filename. For example:

1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S

Using fat32 format on the USB stick may be part of the problem but I
don't want to change to a different format for other reasons.

What is the best way to backup these emails or how do others handle
this?


I don't back up to FAT filesystems. Put a real filesystem on your USB stick, eg 
XFS. This mirrors the advice of another poster.


Cheers,
Cameron Simpson 


Re: How to backup emails with colon in file name

2017-06-27 Thread Jason
On Tue, Jun 27, 2017 at 04:56:39PM +0100, Darac Marjal wrote:
> On Tue, Jun 27, 2017 at 10:00:32AM -0500, Jason wrote:
> >I use rsync for doing incremental backups to a USB stick. I am having
> >a problem that rsync does not like backing up my mutt emails since
> >they contain a colon in the filename. For example:
> >
> >1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S
> >
> >Using fat32 format on the USB stick may be part of the problem but I
> >don't want to change to a different format for other reasons.
> >
> >What is the best way to backup these emails or how do others handle
> >this?
> 
> Colons are illegal characters in a FAT filename. So you need a way
> around that. You could "mangle" the filenames (that is, transform them
> in a predictable manner), but you'd need to remember to 'unmangle' them
> when doing a restore.
> 
> So another option is to bypass FAT and delegate the job of handling the
> files to another system. In other words, archive the files. TAR and CPIO
> are good candidates here (I'd favour CPIO in this case as I know it
> handles obscure cases best).
> 
> However, you want to use rsync and that doesn't usually work with
> archive files. So, I'm going to suggest a third tool here: archivemount.
> archivemount is a "fuse" (filesystem in userspace). It opens an archive
> and presents it as a filesystem, mounted in a new directory.
> 
> So, the idea would be, you create a small target archive (archivemount
> can add to existing archives, but it can't create them from scratch),
> archivemount that somewhere and then rsync between your mail folder and
> the mount point. This will funnel all the data into a single file on the
> USB drive. Unmounting the directory will close the file. Next time you
> want to back up, you archivemount the same file, rsync to the mount
> point and the changes will be applied. Magic.

I've been experimenting with tar. Let's say I decide to use tar and
forget about using rsync for mails, what would be some good options to 
use to only update the archive with new files? I have tried:

tar uGvf ~/Main/mail.tar /path/to/maildir

but it seems every time it is run it just adds copies of everything to
the archive again, instead of just what was added since last time.

> 
> >
> >Thanks for any help.
> >-- 
> >Jason
> 
> -- 
> For more information, please reread.


Thank you.
-- 
Jason


Re: How to backup emails with colon in file name

2017-06-27 Thread Ian Zimmerman
On 2017-06-27 21:05, Bastian wrote:

>   c Don't use fat (sry, could not resist)

While we're at it, using a USB flash (I assume) stick for backups is
also not a great idea, independently of the file system on it.

-- 
Please *no* private Cc: on mailing lists and newsgroups
Personal signed mail: please _encrypt_ and sign
Don't clear-text sign:
http://primate.net/~itz/blog/the-problem-with-gpg-signatures.html


Re: How to backup emails with colon in file name

2017-06-27 Thread Bastian
After following the thread a bit, my thoughts:

On 27Jun17 20:22 +0200, Simon Thelen wrote:
> On 17-06-27 at 11:20, Jason wrote:
> > On Tue, Jun 27, 2017 at 05:49:30PM +0200, Simon Thelen wrote:
> > > On 17-06-27 at 10:00, Jason wrote:
> > > > I use rsync for doing incremental backups to a USB stick. I am having
> > > > a problem that rsync does not like backing up my mutt emails since
> > > > they contain a colon in the filename. For example:
> > > > 
> > > > 1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S
> > > > 
> > > > Using fat32 format on the USB stick may be part of the problem but I
> > > > don't want to change to a different format for other reasons.

>From my experience I would recommend _not_ to do file system based 
backups (like with rsync) where the data source file system has more 
capabilities as the destination. Just don't do it. Chances are high 
you'll run into troubles at other locations, too.

There have been some helpful thoughts already on this threads. But 
nothing seem to fit. Here some more brainstorming:

  a Switch over from Maildir to mbox, with all its pros and cons, pro 
for your would be file name issue solved!
  b Write your own fuse fs
The API is really not too complicated. If you can code, you could 
remount your Maildir into another dir, which on the fly does s.th. 
like s/:/_/
Having that ro would also be enough, for backing up - restore is 
then another story.
Then exclude the src Maildir in rsunc and just backup the fuse mount
  c Don't use fat (sry, could not resist)


Have fun,
-- 
Bastian


Re: How to backup emails with colon in file name

2017-06-27 Thread Simon Thelen
On 17-06-27 at 11:20, Jason wrote:
> On Tue, Jun 27, 2017 at 05:49:30PM +0200, Simon Thelen wrote:
> > On 17-06-27 at 10:00, Jason wrote:
> > > I use rsync for doing incremental backups to a USB stick. I am having
> > > a problem that rsync does not like backing up my mutt emails since
> > > they contain a colon in the filename. For example:
> > > 
> > > 1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S
> > > 
> > > Using fat32 format on the USB stick may be part of the problem but I
> > > don't want to change to a different format for other reasons.
> > Fat32 doesn't like : afaik (I'm pretty sure all windows-based file
> > systems don't since that's the drive/path separater)
> > 
> > > What is the best way to backup these emails or how do others handle
> > > this?
> > Either write a script that backs the files to a temporary directory and
> > then renames them to remove the colons, use a program besides rsync that
> > can handle this case (I believe rdiff-backup can) or I believe there are
> > fuse layers that can handle this transparently (fuse-posixovl etc).
> 
> But how can a different program work if the problem lies with the
> fat32 filesystem? I know drag and drop using pcmanfm file manager does
> not work either. Maybe I'll end up trying your first suggestion
> (copying to a temporary directory and renaming).
Certain programs have the ability to mangle filenames for filesystems
that don't support certain characters. rdiff-backup for instance will
also mangle filenames with upper/lower casing for case-insensitive filesystems
to prevent collisions.

(and sorry for earlier off-list reply, forgot to add mutt-users to my
subscribe line)

-- 
Simon Thelen


Re: How to backup emails with colon in file name

2017-06-27 Thread Jason
On Tue, Jun 27, 2017 at 05:49:30PM +0200, Simon Thelen wrote:
> On 17-06-27 at 10:00, Jason wrote:
> > I use rsync for doing incremental backups to a USB stick. I am having
> > a problem that rsync does not like backing up my mutt emails since
> > they contain a colon in the filename. For example:
> > 
> > 1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S
> > 
> > Using fat32 format on the USB stick may be part of the problem but I
> > don't want to change to a different format for other reasons.
> Fat32 doesn't like : afaik (I'm pretty sure all windows-based file
> systems don't since that's the drive/path separater)
> 
> > What is the best way to backup these emails or how do others handle
> > this?
> Either write a script that backs the files to a temporary directory and
> then renames them to remove the colons, use a program besides rsync that
> can handle this case (I believe rdiff-backup can) or I believe there are
> fuse layers that can handle this transparently (fuse-posixovl etc).

But how can a different program work if the problem lies with the
fat32 filesystem? I know drag and drop using pcmanfm file manager does
not work either. Maybe I'll end up trying your first suggestion
(copying to a temporary directory and renaming).

Thanks for your response.
Jason


> 
> -- 
> Simon Thelen


Re: How to backup emails with colon in file name

2017-06-27 Thread Jason

On Tue, Jun 27, 2017 at 11:15:50AM -0400, Patrick Shanahan wrote:
> * Jason  [06-27-17 11:05]:
> > I use rsync for doing incremental backups to a USB stick. I am having
> > a problem that rsync does not like backing up my mutt emails since
> > they contain a colon in the filename. For example:
> > 
> > 1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S
> > 
> > Using fat32 format on the USB stick may be part of the problem but I
> > don't want to change to a different format for other reasons.
> > 
> > What is the best way to backup these emails or how do others handle
> > this?
> 
> not tried:  enclose file-name in quotes.
> 
> maybe tr to change from ":" to "\:" but fat32 might not like that???

Thanks for your reply.

I use a one line rsync command from a shell script to recursively
backup my file tree so I'm not sure how any of the above suggestions
could be incorporated into that. I've thought about using a script to
replace ":" with another character but I could not do that very well
_in place_ as I assume that could mess up mutt, or at least cause mutt
to rename the file back.

OTOH, to copy all the files to another location to rename, and then
backup from there, seems like a bit of overkill.



> -- 
> (paka)Patrick Shanahan   Plainfield, Indiana, USA  @ptilopteri
> http://en.opensuse.orgopenSUSE Community Memberfacebook/ptilopteri
> Registered Linux User #207535@ http://linuxcounter.net
> Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode


Re: How to backup emails with colon in file name

2017-06-27 Thread Darac Marjal

On Tue, Jun 27, 2017 at 10:00:32AM -0500, Jason wrote:

I use rsync for doing incremental backups to a USB stick. I am having
a problem that rsync does not like backing up my mutt emails since
they contain a colon in the filename. For example:

1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S

Using fat32 format on the USB stick may be part of the problem but I
don't want to change to a different format for other reasons.

What is the best way to backup these emails or how do others handle
this?


Colons are illegal characters in a FAT filename. So you need a way
around that. You could "mangle" the filenames (that is, transform them
in a predictable manner), but you'd need to remember to 'unmangle' them
when doing a restore.

So another option is to bypass FAT and delegate the job of handling the
files to another system. In other words, archive the files. TAR and CPIO
are good candidates here (I'd favour CPIO in this case as I know it
handles obscure cases best).

However, you want to use rsync and that doesn't usually work with
archive files. So, I'm going to suggest a third tool here: archivemount.
archivemount is a "fuse" (filesystem in userspace). It opens an archive
and presents it as a filesystem, mounted in a new directory.

So, the idea would be, you create a small target archive (archivemount
can add to existing archives, but it can't create them from scratch),
archivemount that somewhere and then rsync between your mail folder and
the mount point. This will funnel all the data into a single file on the
USB drive. Unmounting the directory will close the file. Next time you
want to back up, you archivemount the same file, rsync to the mount
point and the changes will be applied. Magic.



Thanks for any help.
--
Jason


--
For more information, please reread.


signature.asc
Description: PGP signature


Re: How to backup emails with colon in file name

2017-06-27 Thread Patrick Shanahan
* Jason  [06-27-17 11:05]:
> I use rsync for doing incremental backups to a USB stick. I am having
> a problem that rsync does not like backing up my mutt emails since
> they contain a colon in the filename. For example:
> 
> 1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S
> 
> Using fat32 format on the USB stick may be part of the problem but I
> don't want to change to a different format for other reasons.
> 
> What is the best way to backup these emails or how do others handle
> this?

not tried:  enclose file-name in quotes.

maybe tr to change from ":" to "\:" but fat32 might not like that???
-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  @ptilopteri
http://en.opensuse.orgopenSUSE Community Memberfacebook/ptilopteri
Registered Linux User #207535@ http://linuxcounter.net
Photos: http://wahoo.no-ip.org/piwigo   paka @ IRCnet freenode


How to backup emails with colon in file name

2017-06-27 Thread Jason
I use rsync for doing incremental backups to a USB stick. I am having
a problem that rsync does not like backing up my mutt emails since
they contain a colon in the filename. For example:

1498570870.M370636P2743Q2R5bbb999d0aefc481.net1:2,S

Using fat32 format on the USB stick may be part of the problem but I
don't want to change to a different format for other reasons.

What is the best way to backup these emails or how do others handle
this?

Thanks for any help.
-- 
Jason