Raised This Month: $51 Target: $400
 12% 

nVault backup


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 12-17-2018 , 11:20   nVault backup
Reply With Quote #1

I want to take back up my nvault file every 30days after and it will make a new file and store new data how can i done this. using nvault array for storing
__________________
Let's Help Each Other
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-17-2018 , 12:25   Re: nVault backup
Reply With Quote #2

Make sure the vault is closed, copy the file, give it a new name (suffix a date for example) and delete the old one.
__________________
klippy is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 12-17-2018 , 12:34   Re: nVault backup
Reply With Quote #3

With amxx, the only ways I can suggest is: calculate in seconds how much time left to 1st day of next month and set a task with the result of the calc as its time or compare the date in plugin_init. In task function duplicate the vault file. Or consider using mysql which would be the best and easiest way to backup.

You can also try (if you have access to linux vds) to schedule backup tasks.
__________________









Last edited by CrazY.; 12-17-2018 at 12:35.
CrazY. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-17-2018 , 19:24   Re: nVault backup
Reply With Quote #4

I'm surprised there is no file copy native, at least I couldn't find it. If you use nvault correctly you should have no need to do backups. I have not had one become corrupt on me in years, and it only happened because I was using it incorrectly (not closing the vault, server crash, etc). I can write a file copy function for you.
__________________
Bugsy is offline
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 12-17-2018 , 20:53   Re: nVault backup
Reply With Quote #5

Thanks Bugsy got you properly
__________________
Let's Help Each Other
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 12-18-2018 , 17:19   Re: nVault backup
Reply With Quote #6

Quote:
I can write a file copy function for you.
I'd like to have this one too.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-18-2018 , 22:07   Re: nVault backup
Reply With Quote #7

PHP Code:
public bool:copy_file( const szSourceFile[] , const szDestFile[] )
{
    new 
iSource iDest iBytesRead bytBuffer1024 ];
    
    if ( ( 
iSource fopenszSourceFile "rb" ) ) && ( iDest fopenszDestFile "wb" ) ) )
    {
        while ( ( 
iBytesRead fread_blocksiSource bytBuffer sizeofbytBuffer ) , BLOCK_BYTE ) ) )
        {
            
fwrite_blocksiDest bytBuffer iBytesRead BLOCK_BYTE );
        }
        
        
fcloseiSource );
        
fcloseiDest );
    }
    
    return 
bool:( iSource && iDest );

__________________
Bugsy is offline
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 12-18-2018 , 22:08   Re: nVault backup
Reply With Quote #8

cant got :/ how i will use this
__________________
Let's Help Each Other
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-18-2018 , 22:24   Re: nVault backup
Reply With Quote #9

really ?

copy_file( "file you want to copy.txt" , "copied file name.txt" )

copy_file( "SomeSong.mp3" , "Copy of SomeSong.mp3" )
__________________
Bugsy is offline
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 12-18-2018 , 22:34   Re: nVault backup
Reply With Quote #10

got it now
__________________
Let's Help Each Other
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode