Very Hot Topic (More than 25 Replies) Sesame Nightly Backup procedure (Read 7894 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Sesame Nightly Backup procedure
Apr 7th, 2011 at 5:17pm
Print Post Print Post  
The 'backup' option within an Ap is good, but only for one ap at a time. I'm looking for a quick way to make nightly backups of numerous Sesame applications in a batch (or backup the entire sesame/data folder. )

Is it OK to COPY the DB and DAT files to another folder while they are being served?  While users are active in the application?

If not, then i have to find a way to notify remote users to log out so I can start the backup process.

Thanks for any insight.

Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #1 - Apr 7th, 2011 at 5:43pm
Print Post Print Post  
Steve_in_Texas wrote on Apr 7th, 2011 at 5:17pm:
The 'backup' option within an Ap is good, but only for one ap at a time. I'm looking for a quick way to make nightly backups of numerous Sesame applications in a batch (or backup the entire sesame/data folder. )

Is it OK to COPY the DB and DAT files to another folder while they are being served?


Generally yes, though the resulting file will be locked.


Quote:
 While users are active in the application?


Active - yes. Writing - no. You will want to suspend the server to prevent writes. This can be done using the process suspend in your OS, or can be done using the Sesame suspend command in the admin comand flags.

Quote:
If not, then i have to find a way to notify remote users to log out so I can start the backup process.

Thanks for any insight.

Steve


Using the Global Values commands and an active check, or the admin messaging, you could let them know to close forms etc...
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #2 - Apr 7th, 2011 at 5:49pm
Print Post Print Post  
Thanks Mark. This is all good news and will help to minimize the server down time.

Sincerely,

Steve
  
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Sesame Nightly Backup procedure
Reply #3 - Apr 7th, 2011 at 10:09pm
Print Post Print Post  
Thanks for discussing this topic. I have the same query. I backup all files in sesame2 folder with subfolders, locally as well as in the cloud, at night when nobody is actively working but many of the files will be loaded in server. What I understand from discussion that even the loaded files, .db and .dat files will be backed up fine only they would be locked if you ever have to restore them.

That is indeed a good news. As I want people to start working with the system early in a.m., so I have to leave server on and at times I closed the server and fresh started server again so, no files were loaded thinking that loaded file might not be backing up to restorable state.

Thanks for clarification.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #4 - Apr 8th, 2011 at 5:44pm
Print Post Print Post  
This seems to work well....

In a Windows environment, these three lines can be saved in a .bat file and run from any windows client.

sesame server will suspend
The xcopy command with /D will copy any CHANGED files to a backup folder. /Y will overwrite any existing files!
sesame server will continue

after running this batch file, you can then move/upload/encrypt the files in your /backup folder.

Seems to work well, but I think sesame requires a free client seat to run this routine.

(replace 'servername' and 'password' with your own info)

Code
Select All
c:\sesame2\program\sesame.exe -COMMAND servername:20020:20021 password SUSPEND
xcopy c:\sesame2\data\*.* c:\backups /D /Y
c:\sesame2\program\sesame.exe -COMMAND servername:20020:20021 password CONTINUE
pause
 

  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #5 - Apr 8th, 2011 at 7:29pm
Print Post Print Post  
For the edification of Unix users: "cp -r" will do nicely in place of xcopy. And for all, the command line "sunlock" command can unlock the copied application files from a shell/batch file.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #6 - Apr 8th, 2011 at 7:34pm
Print Post Print Post  
Excellent. And I suppose this batch file will run well from some sort of 'task manager' so it can run automatically each night around midnight, or so.

Very cool!
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #7 - Apr 8th, 2011 at 7:38pm
Print Post Print Post  
On Unix, you would use "cron" or one of its alternatives to kick off a task on a schedule.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #8 - Apr 8th, 2011 at 7:44pm
Print Post Print Post  
BTW, have you tried using the sesame.ini file entries for backing up apps? These are server wide settings and don't require OS intervention.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #9 - Apr 8th, 2011 at 8:16pm
Print Post Print Post  
I just created and opened a sesame.ini file for the first time. I assume you are referring to BACKUP ON INTERVAL:

This sounds very convenient, but is this as 'safe' as the above batch file? (Will the server 'SUSPEND' any active clients before backing itself up?)

Off-topic, I see some other commands which piques my interest, but are not listed in the user's guide. Any documentation on TABLE DISPLAYS IMAGES? (images in table mode would be incredible!)
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #10 - Apr 8th, 2011 at 8:27pm
Print Post Print Post  
Steve_in_Texas wrote on Apr 8th, 2011 at 8:16pm:
I just created and opened a sesame.ini file for the first time. I assume you are referring to BACKUP ON INTERVAL:

This sounds very convenient, but is this as 'safe' as the above batch file? (Will the server 'SUSPEND' any active clients before backing itself up?)


I'm not sure which is "safer". I know the interval backup will wait until there are no active write operations. But it may be possible that a write op can occur after the backup has started. Unlikely though.

Quote:
Off-topic, I see some other commands which piques my interest, but are not listed in the user's guide. Any documentation on TABLE DISPLAYS IMAGES? (images in table mode would be incredible!)


Turn it on and give it a try. Is there anything in particular you want to know about it?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #11 - Apr 8th, 2011 at 8:35pm
Print Post Print Post  
Then BACKUP ON INTERVAL should be a good option for a 2am backup routine. I'll keep it in mind.

I'm also reading up on CP and Cron commands in Linux.

Thanks for the help!
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #12 - Apr 8th, 2011 at 8:39pm
Print Post Print Post  
Images in table mode is a GREAT feature! I've steered our users away from table mode so often because I thought it could not display images. Nice to know it's possible.

Looks like my images need to be re-sized for a clean table appearance, and to keep the table responsive when working over an internet connection.

But at a glance, it looks terrific! Is there an option to 'force' the images to a specific size during display in table mode?
  
Back to top
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: Sesame Nightly Backup procedure
Reply #13 - Apr 8th, 2011 at 10:44pm
Print Post Print Post  
Steve, one of the things Ubuntu does to make Linux more user-friendly is it tries as much as possible to use GUI programs instead of command lines.  I have never tried scheduling anything in Linux but before you get too deep in command shell programs, check out the Ubuntu Software repository. It's somewhere under Applications.  Chances are you'll find something there.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #14 - Apr 9th, 2011 at 5:47am
Print Post Print Post  
Steve_in_Texas wrote on Apr 8th, 2011 at 8:39pm:
But at a glance, it looks terrific! Is there an option to 'force' the images to a specific size during display in table mode?


Steve,
I'm not positive and its nearly 2 AM, but I think the width of a column is set by the width of the element it represents. An image will scale proportionally. So if you set the width, the height should scale so that the image is not stretched or squashed out of proportion.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #15 - Apr 9th, 2011 at 6:15am
Print Post Print Post  
If you prefer the GUI approach and are using the Gnome desktop, you might consider installing "gnome-schedule" or if you prefer KDE (I do), you can use can use the task scheduler located under system > system setting menu. Both work on either desktop, but may already be installed on the one that they were built for.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #16 - Apr 9th, 2011 at 2:32pm
Print Post Print Post  
Thank you, Gentlemen.

For a sesame server running on Linux (Ubuntu)....

I installed 'scheduled-tasks' from the Gnome install screen and found it simple to add a new task to run each night.

I then used gedit to create a file called 'sesame-backup' with the below code.  It (apparently) paused sesame server, copied all by data files to a folder, then un-paused the server in a blink of an eye. (the -u will copy only CHANGED files.)

Used linux commands to make the file executable.

Code
Select All
/home/steve/sesame/Program/sesame -COMMAND myserver:20020:20021 password SUSPEND
cp -u /home/steve/sesame/data/*.* /home/steve/sesame/data/backups
/home/steve/sesame/Program/sesame -COMMAND myserver:20020:20021 password CONTINUE
 



Next I'll add a task (or add a line to the batch file) to ftp the backup files to a secure location.

Mark, thanks for all your help. Running sesame on Linux has really put the fun back into sesame. I really appreciate it.

Steve

  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #17 - Apr 10th, 2011 at 1:43pm
Print Post Print Post  
Mark,

The procedure I used on Linux causes a 'new user' to be connected (myserver) and STAY connected after the backup is finished.

Any way to disconnect just this 'user' after completing the backup? Or make the backup without connecting as a new user?

Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #18 - Apr 11th, 2011 at 2:14pm
Print Post Print Post  
Steve_in_Texas wrote on Apr 10th, 2011 at 1:43pm:
Mark,

The procedure I used on Linux causes a 'new user' to be connected (myserver) and STAY connected after the backup is finished.

Any way to disconnect just this 'user' after completing the backup? Or make the backup without connecting as a new user?

Steve



That is a little odd. I just tried the code you posted above and Sesame server doesn't have time to acknowledge the connection. It connects, runs the command, and disconnects completely, without increasing the client count at all. In any case, the "admin" and "command" connections get counted separately from normal client connections and do not add to the client count when checking against the license limit. So, even if you have a full client count, you can still connect as admin or command.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #19 - Apr 11th, 2011 at 3:29pm
Print Post Print Post  
It sounds like we can 'shrug off' this issue, except that i think the server will not 'gracefully' shut down while these 'admin' users are logged in.

(If i remember correctly, Sesame Server counts down 90 seconds, then gives a Segmentation Fault when trying to stop the server.)

I'll test it again tonight to confirm.

Sincerely,
Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #20 - Apr 11th, 2011 at 4:30pm
Print Post Print Post  
That's two for two. I don't see the command client using any licenses, never mind staying logged in. And I haven't seen any segmentation faults when shutting down the server.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #21 - Apr 11th, 2011 at 4:41pm
Print Post Print Post  
I'm referring to the listing of 'clients' on the Notification tab in the admin panel.

After running the backup command, I see my server machine name listed twice, each time I run the backup routine.

When I try to 'Stop This Server' from the servers tab, I get the countdown and the error message.

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #22 - Apr 11th, 2011 at 4:50pm
Print Post Print Post  
FYI, my backup takes about 30 seconds to complete, which is plenty fast for me, but maybe that's just long enough to prevent the 'command client' from disconnecting.
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #23 - Apr 11th, 2011 at 4:59pm
Print Post Print Post  
Your backup doesn't start running until after the first command completes, and on my machines - disconnects. You probably don't want this in this case, but on Unix, if you type a "&" at the end of a command line (or line in a shell script), that command line will run as a separate process and give your command prompt back before that process completes.

So basically, these 3 command all run at once:

cp -v -r /etc /home/steve/MyEtc &
ls -lR /home/steve &
tar xvzf sesame.tgz sesame sdesigner /home/steve/Sesame/data
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #24 - Apr 11th, 2011 at 5:20pm
Print Post Print Post  
OK, i'll add the '&' to first two lines and try again tonight.

Thanks!
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #25 - Apr 11th, 2011 at 11:31pm
Print Post Print Post  
I added the '&' but get the same results.

During my backup procedure, the client COUNT on the server GUI does not increase, but MYSERVER name does appear twice in the admin panel's list of connected clients.

When I use the 'shutdown this server' command, i get the countdown. After 90 seconds, sesame shuts down and give this message in the terminal window:

Error: Client connection failed. Client authentication error.
Segmentation fault

without running the backups routine, sesame will gracefully disconnect me from the admin panel and close without the 90 sec. countdown.

Seems like we need a command to disconnect MYSERVER after making the backup?

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #26 - Apr 11th, 2011 at 11:33pm
Print Post Print Post  
And now i see that my aps that were loaded are locked. Sad
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #27 - Apr 12th, 2011 at 12:35pm
Print Post Print Post  
As I said, you really don't want the "&" in this case. I was just letting you know how to do something generally useful. In this case you really want each command to finish before the next starts.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #28 - Apr 12th, 2011 at 2:34pm
Print Post Print Post  
OK, thanks Mark. I'll revert to my old code, but the results will be the same.

If you can think of a different option that will not have 'shutdown issues', please let me know.

Sincerely,

Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #29 - Apr 12th, 2011 at 2:49pm
Print Post Print Post  
The script you posted earlier does not issue the shutdown, nor should it. Why are you shutting down the server? I will try again to reproduce the problems you are having, but so far I haven't seen any of them here.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #30 - Apr 12th, 2011 at 3:26pm
Print Post Print Post  
Perhaps because of my Windows 'up-bringing', I'm a firm beleiver of 'rebooting often'. Hopefully, I can leave the Linux server running more often, but I do see a need to reboot every few days, at least.

My biggest reason; After loading,unloading, and designing my largest aps, The sesame Terminal windows shows this error message: "Warning! File buffer allocation is greater than half of available memory."

At this point, I observe loading times slow down dramatically (perhaps the memory is swapping). Rebooting the machine has always fixed this issue.

So, my concern; after using the '-command' option, I can no longer get a graceful shutdown when I use 'stop this server' option from within the admin panel.

Perhaps there is a better method for shutting down the server?

Steve

  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #31 - Apr 12th, 2011 at 3:28pm
Print Post Print Post  
FYI, when I use 'stop this server' button, many of my aps are still loaded in the server.

I can try to unload the aps before stopping the server, but the reason for this thread was to make a backup while users are in the database.

Many thanks!
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sesame Nightly Backup procedure
Reply #32 - Apr 12th, 2011 at 3:41pm
Print Post Print Post  
You should almost never reboot a Unix box. I have had boxes that have up-times measured in years. It is much better about memory management than Windows.

The loading message is caused by the new application loader. Instead of reading the file in a bit at a time, it reads the whole file in one big chunk and then parses that out to the final in memory structure and deallocates the big chunk. So, temporarily it needs twice as much memory. If there is not enough memory, it will revert to the older load. That message means that it will use the older load, which should only affect the speed of loading applications, not general run speed.

You should not reboot your server computer because you are backing up Sesame files. In general, on Unix, the only reason to shutdown the box is when you get a kernel update, the room is on fire, or you simply want to save electricity.

You can shutdown Sesame using the same command interface you are using to suspend and resume.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #33 - Apr 12th, 2011 at 3:51pm
Print Post Print Post  
Mark, good to know that Linux does not need frequent shutdowns. I'll revise my thinking.

Yes, the slowdown is only on load times. Sesame still runs at blazing speeds once it gets the ap loaded! Smiley

Also, nice to know the warning message I'm seeing is nothing urgent.

I'll leave sesame running 24/7 and not worry about all the 'clients' that will stack up in the admin panel during the backup routines.

Sincerely,
Steve
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Sesame Nightly Backup procedure
Reply #34 - Apr 12th, 2011 at 5:25pm
Print Post Print Post  
Hello Steve,

I also just tried this on my Linux box and am unable to reproduce the clients stacking up in the admin panel. Can you send me your Sesame.ini file in case there is something in there that I need?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Sesame Nightly Backup procedure
Reply #35 - Apr 12th, 2011 at 5:37pm
Print Post Print Post  
Will do.

Thanks.
  
Back to top
IP Logged