Howto: Sync profiles using dropbox

Spinner
Posts: 1
Joined: Fri Aug 26, 2016 12:11 pm

Syncing between Windows and Mac

Post by Spinner »

I would like to sync my profile between Windows 10 and Mac OS X el capitan. Any suggestions? At the moment I'm just using profile export and import but that requires tons of clicking and fiddling.

lunloon
Posts: 9
Joined: Mon Feb 06, 2017 4:55 am

Re: Howto: Sync profiles using dropbox

Post by lunloon »

I have synced my profiles across 2 computer over dropbox.
Triggers, scripts and aliases are ok.
When i checked my variables, they are not synced. They worked nicely on computer 1 but it's not there in computer 2. Everything else is, including the triggers in which I made some Lua script which set some global variables.
These variables did not get synced on computer 2.
Anyone experienced this before?

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Howto: Sync profiles using dropbox

Post by Vadi »

Variables are temporary things that get created when Mudlet starts. If you'd like it to be permanent, make a script that does:

variable = "something"

That way it'll get created everytime and since your script will be synced, so will be the variable.

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Howto: Sync profiles using dropbox

Post by SlySven »

If you are sharing the same "save" file (the ones with a date and time as the filename stored in the HOMEDIRECTORY/.config/mudlet/<profileName>/current/ sub-directory) between the two machines/OSs {perhaps your HOMEDIRECTORY/.config/mudlet directory is a network share(different machines) / symlink (multi-boot OS on the same machine)} that is writeable - then variables can be marked to be "saved" with the rest of the profile data between sessions if you bring up the "Variables" display and click on the check-boxes against the variables/tables in the tree on the left side for the required table/variables to be saved!

Also, a new feature for the recent release 3.0 previews / development branches is that you can now store data in a "Map" user area in a map file so if you are sharing and updating a map between those different PCs that might be another solution to storing variables.

lunloon
Posts: 9
Joined: Mon Feb 06, 2017 4:55 am

Re: Howto: Sync profiles using dropbox

Post by lunloon »

Edited: The more i think about it the more confused i became.

So essentially getmudhomedir() should be the same on any machine as long as the mudlet on each machine has mklink the .config to the one on dropbox. i want to make a table and save it using getmudhomedir() (pardon the no caps for now).

Also, the variables i set in Variables should be ticked to get them saved in the profile (if i am not able to make the table). But it seems that mudlet does not load the variables on startup. Do I have to make a script to do that?

I'm sorry I am very confused.

lunloon
Posts: 9
Joined: Mon Feb 06, 2017 4:55 am

Re: Howto: Sync profiles using dropbox

Post by lunloon »

So I redid the table in Variables, forced a table.save on one of the triggers, and now there's a file in the profile which i got a script to table.load when mudlet starts up. Hope this is correct.
Going to check the other computer tomorrow.

gimpel
Posts: 1
Joined: Thu Nov 16, 2017 9:38 pm

Re: Howto: Sync profiles using dropbox

Post by gimpel »

I have a question, and perhaps an answer for Spinner.

I am syncing between a Mac and PC. For years I did this manually, emailing myself the .xml file to import, such that each machine had their own mostly unique profile. The problem came when I would code something and forget which machine I coded it on. So... now I sync them. Each of them have different sized monitors, and require different control keys as well. To accommodate this I have taken every script/alias/trigger/key that is unique to each machine, and created a new profile that has both. I then deactivate the PC stuffs, when I'm on the MAC, and vice versa. It actually works! I hope that helps.

HERE is the question:
-In mudlet2 when I sync the files, it seems that neither the mac nor the pc properly takes the proper ...current/*.xml file. It always thinks the current one is whatever previous one it had. I have to manually tell mudlet to choose the most recent date of the save file. Only, when I do, it doesn't always grab the most current one. (I test this by adding new triggers).

I have no idea why this is. If anyone can help me out here.

My working solution right now is this:
When I run the sync between the two computers, I then run a script afterwards that eliminates all but the most recent .xml save file. (it moves it to a different location).

When I do this, mudlet works fine. But I know this is a bit of a hack and am wondering if anyone out there has a better idea.

here's the mac side script I run:

<pre>
#!/bin/sh

profcurrentdir=/Users/me/.config/mudlet/profiles/CHARNAME/current

cd $profcurrentdir
mostcurrfile=`ls *.xml|tail -n 1`
movedir=/Users/me/.config/mudlet/profiles/CHARNAME/aa_oldprofiles/

mostcurrfile=`ls *.xml |tail -n 1`

#find the most current file, then copy all the OTHER files into a directory
find ./ -maxdepth 1 -mindepth 1 -not -name $mostcurrfile -print|xargs -I {} mv {} $movedir
</pre>

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Howto: Sync profiles using dropbox

Post by Vadi »

Mudlet sorts the files by the last modified timestamp and loads that in. I guess Dropbox is not syncing it in order and this is where it would be good if Mudlet actually read the timestamps in the file.

Tesagk
Posts: 13
Joined: Sat May 28, 2016 12:04 pm

Re: Howto: Sync profiles using dropbox

Post by Tesagk »

For some reason, I can't seem to get this to work on my new laptop. The weird thing is, it worked just fine on my old laptop. All the machines have Windows 10. But, every time I try to make the make-link, it gets written over when I start Mudlet again. Sadly, I can't access the old laptop right now to see what I'm doing wrong, but I'm hoping my super-vague description will help inspire enough ideas that we can figure it out.

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Howto: Sync profiles using dropbox

Post by SlySven »

If the two machines are different OSes then `getOs()` has been improved recently to report more than only Windows/Linux/macOs (for instance it'll pick out that I'm running on a PC booted into FreeBSD at the moment).

I have a slightly easier to solve problem than yourself as I need a partition that both Linux and FreeBSD (and eventually Windows?) can read and write (which rules out ext4 on Linux and ufs/zfs on FreeBSD - because Debian dropped their support for writing to ufs filesystems in the current version "Stretch") which leaves either ext2 (with a ext2fs driver on Windows - there are some but they don't tend to work well with later than ext2 or possibly 64-bits or Win10 or a combination of some of these AFAICT) or possibly a fat or ntfs filesystem. I then made symbolic links from the mudlet/profile/<profile_name> directory with the name of the particular profiles I wanted to share to the named directory in the common/shared platform. So whether I am running on my main development PC in Linux or FreeBSD some profiles are actually using the same set of files for either. It may be simpler to make a single link of the mudlet/profile/ folder itself so that all the profiles in the system are shared across all OSs; though if packages are also shared it might be that the base mudlet is the one to do. This might be made more tricky because Mudlet itself makes a mudlet-data symbolic link from the users home directory to that one, e.g. /home/<userName>/mudlet-data to /home/<userName>/.config/mudlet on *nix platforms.

Now, in your case, sharing a common profile folder for the same profile in two different PCs could work in the same manner if only there is a folder that they both can access and which you can make a symbolic link to. Do you play entirely at home on a LAN? If so - does your modem/router have provision for a USB drive for media sharing and is there a way for you to make a symbol link to it? (It has to be symbolic in most cases because hard links are confined to the same device - Windows can do something similar with directory junctions or even what it calls symbolic links)?

Actually, thinking about it I have some cloud storage that would work for this on Windows/Linux from SpiderOak - when that is running (in the background) any files that are placed in a synced folder are replicated across all machines with a folder similarly synced (and securely - with "no knowledge" of the material - on the SpiderOak cloud servers) - by default these days the installation automatically creates a specific "SpiderOak Hive" folder off of your home directory in Linux or "My Documents" in Windows - what is of particular merit is that their system encrypts everything and makes a copy every time it changes and a sync takes place but it keeps those copies around and because changes in files are often only on small places it de-duplicates the copies and stores the differences to reduce the overall size to a minimum - you can always restore those backups if they are important or remove them if not. I started out with a free and unlimited 2GByte trail over five years ago but nowadays its $5 a month for 150GB with a 21 days only free-trial...

Post Reply