anchor.diff:      {_, NodeType} = lists:keyfind(node_type,1,Params),
       {_, SchemaName} = lists:keyfind(schema_name,1,Params),
       {_, SnapInterval} = lists:keyfind(snap_interval,1,Params),
  -    {_, SnapDir} = application:get_env(imem, imem_snapshot_dir),
       SDir = atom_to_list(SchemaName) ++ "." ++ atom_to_list(node()),
       {ok, Cwd} = file:get_cwd(),
       LastFolder = lists:last(filename:split(Cwd)),
  
positive.code:                                 NewBackFile = filename:join([SnapDir, atom_to_list(T)++".bkp.new"]),
                                  ok = file:write_file(NewBackFile, term_to_binary(Rows)),
                                  {ok, _} = file:copy(NewBackFile, BackFile),
                                  ?Log("snapshot created for ~p~n", [T]),
                                  ok = file:delete(NewBackFile)
                                 end),
                  true = ets:insert(?MODULE, Up#user_properties{last_snap = erlang:now()});
  
negative.code:     mnesia:subscribe(system),
      ?Log("~p started as ~p!~n", [?MODULE, NodeType]),
      if SnapInterval > 0 -> erlang:send_after(SnapInterval, self(), snapshot); true -> ok end,
      {_, SnapDir} = application:get_env(imem, imem_snapshot_dir),
      SnapshotDir = filename:absname(SnapDir),
      ?Log("SnapshotDir ~p~n", [SnapshotDir]),
      {ok,#state{snap_interval = SnapInterval, snapdir=SnapshotDir}}.
  
  handle_call(_Request, _From, State) ->
      {reply, ok, State}.
  