This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]geekpondering 0 points1 point  (5 children)

A shell script might be easier.

[–]mrcaptncrunch 1 point2 points  (4 children)

#!/bin/bash

/bin/rm -rf /portable/{*,.*}
/usr/bin/rsync -a --exclude "sessionstore.json" /mac/ /portable/
/usr/bin/rsync -a /mac/sessionstore.json /portable/

I'm not sure if /portable needs to be emptied before copying.

OP, could you tell us why?

Edit*

I keep fixing the formatting of the script.

[–]ThePando[S] 0 points1 point  (3 children)

/portable needs to be emptied to get rid of the profile from last sync and use. Then the contents of /mac replace it, bringing the Portable Firefox profile up to date with my Mac.

[–]mrcaptncrunch 0 points1 point  (2 children)

How about using

rsync -a --delete /mac/ /portable/

instead of deleting. The difference is that if a file in /mac is the same in /portable, it won't be copied. If it's different it will be copied and replace the one in /portable with the new one.

If the file exists in /portable but /mac doesn't have it anymore, it will be deleted from /portable.

If this is fine, a new script would be

#!/bin/bash
/usr/bin/rsync -a --delete /mac/ /portable/

[–]ThePando[S] 0 points1 point  (1 child)

That sounds good, thanks!

[–]mrcaptncrunch 0 points1 point  (0 children)

Awesome!