tdl to make auto backup

Discussion in 'Free Source Codes' started by vakul, Aug 23, 2018.

         
  1. vakul

    vakul Member


    i want tdl to take backup ,
    when we quit tally is always take backup first
     




  2. Devaki

    Devaki Member


    [System: Events]

    TSPL Smp CmpLoadEvent2 : Load Company : NOT $$IsRemoteCompany : Call : Backup Function

    ;; Close Company Event
    TSPL Smp CmpCloseEvent : Close Company : NOT $$IsRemoteCompany : Call : Backup Function

    ; TSPL Smp CmpBackUp : Close Company : NOT ($IsAggregate:Company:##SVCurrentCompany) AND NOT $$IsRemoteCompany : Call : Backup Function : CALL : BackupFunction

    [Function: Backup Function]
    Variable : Backup Det Var: String
    00 : IF : ##EnableAutoBackup
    10 : IF : ##AutoBackupPrompt
    20 : QUERYBOX : "Backup Company ?" : Yes:No
    30 : IF : $$LastResult
    40 : CALL : Backup Company
    50 : ENDIF
    60 : ELSE :
    70 : CALL : Backup Company
    80 : ENDIF
    90 : ENDIF

    [Function: Backup Company]
    10 : SET : BackupDetVar : @@DestPath + ", " + ##SVCurrentPath + ", " + ##SVCurrentCompany + +
    ", " + @@CoNumber
    20 : BACKUP COMPANY : "," : ##BackupDetVar
    30 : SET : SVBackupPath : @@DestPath

    [System: Formula]
    DestPath : ##DestinationPath + "\" + @@DateForm + "\" + @@TimeForm
    CoNumber : $$String:($CompanyNumber:Company:##SVCurrentCompany):5
    DateForm : $$String:$$MachineDate
    TimeForm : @@HrsForm + @@MtsForm
    HrsForm : If $$StringPart:$$MachineTime:0:2 CONTAINS ":" +
    Then $$StringPart:$$MachineTime:0:1 +
    Else $$StringPart:$$MachineTime:0:2
    MtsForm : if $$StringPart:$$MachineTime:0:2 CONTAINS ":" +
    Then $$StringPart:$$MachineTime:2:2 +
    Else $$StringPart:$$MachineTime:3:2

    ;; Enable configuration options - used in General of F12 Configuration

    [#Part: System Common]
    Add : Lines : Enable Auto Backup, Auto Backup Path, Auto Backup Path Info, Auto Backup Prompt

    [Line: Enable Auto Backup]
    Field: Long Prompt, Enable Auto Backup
    Local: Field: Long Prompt : Info : $$LocaleString:"Enable Automatic Backup Feature?"
    [Field: Enable Auto Backup]
    Use : Logical Field
    Modifies : EnableAutoBackup

    [Line: Auto Backup Path]
    Field: Long Prompt, Auto Backup Path
    Local: Field: Long Prompt : Info : $$LocaleString:"Destination Path?"
    Local: Field: Long Prompt : Inactive: NOT #EnableAutoBackup
    Local: Field: Long Prompt : Indent : 2
    [Field: Auto Backup Path]
    Use : Name Field
    Modifies : DestinationPath
    Inactive : NOT #EnableAutoBackup
    Set As : If $$IsEmpty:##DestinationPath Then "E:\Autobackup" else ##DestinationPath

    [Line: Auto Backup Path Info]
    Field: Simple Field
    Local: Field: Simple Field : Info : $$LocaleString:"(Subfolders for System Date and Time will be created within)"
    Local: Field: Simple Field : Inactive: NOT #EnableAutoBackup
    Local: Field: Simple Field : Style : Small Italic
    Indent: 1

    [Line: Auto Backup Prompt]
    Field: Long Prompt, Auto Backup Prompt
    Local: Field: Long Prompt : Info : $$LocaleString:"Confirmation from user?"
    Local: Field: Long Prompt : Inactive: NOT #EnableAutoBackup
    Local: Field: Long Prompt : Indent : 2
    [Field: Auto Backup Prompt]
    Use : Logical Field
    Modifies : AutoBackupPrompt
    Inactive : NOT #EnableAutoBackup
    Set As : If $$IsEmpty:##AutoBackupPrompt Then Yes else ##AutoBackupPrompt
    ;; Variable Definition
    [Variable: EnableAutoBackup]
    Type : Logical
    Persistent : Yes
    [Variable: DestinationPath]
    Type : String
    Persistent : Yes
    [Variable: AutoBackupPrompt]
    Type : Logical
    Persistent : Yes
    [System: Variable]
    EnableAutoBackup: Yes
    DestinationPath : "E:\Autobackup"
    AutoBackupPrompt: Yes
    ;;;END OF FILE
     


  3. Amit Kamdar

    Amit Kamdar Moderator Staff Member


    very good...Devaki.....well done
     


  4. Devaki

    Devaki Member


    Thank you sir, but i am not expert as like you.
     


  5. Amit Kamdar

    Amit Kamdar Moderator Staff Member


    Keep doing and you will become one......... never take easy way out........ good luck.

    I am also 5 months old in TDL and joined this site in Feb-end.
     


  6. vakul

    vakul Member


    helpful tdl
    thanks
     


  7. vakul

    vakul Member


    we want tdl to make backup always when we quit tally
     


  8. gaurang712

    gaurang712 New Member


    very good
     


  9. Devaki

    Devaki Member


    i can do it.
    but in my experience no need for tdl . Go to cobian backup. it is very good software for auto-backup
     


  10. vakul

    vakul Member


    can you please make tdl , for auto backup when we quit tally
     



  11. Devaki I like your autobackup TDL , Thanks for sharing , Will you tell me abourt cobian Backup
     


  12. Devaki

    Devaki Member




  13. Thanks a lot Devaki Ji, Can we backup data online directly from this software. Most of the company want to backup copy online to hard disk.Is it possible by giving direct gmail google drive path.
     


  14. satish kumar

    satish kumar New Member


    plz check out it is the best tdl file of auto backup
     

    Attached Files:

    Varun3881 likes this.


  15. Devaki

    Devaki Member


    you can use cobian backup for direct Google drive backup
     



  16. oh Thanks for your advice
    and do you have costcenterwise Trial
     


  17. udaya

    udaya Member


    Devaki nice work....
     






  18. this awsome and very nice but why it is asking for back up while loading of the company ? while closing it is asking fine...
     


  19. Amit Kamdar

    Amit Kamdar Moderator Staff Member


    remove this line............

    TSPL Smp CmpLoadEvent2 : Load Company : NOT $$IsRemoteCompany : Call : Backup Function
     
    Meena Mhatre likes this.


  20. Amit Kamdar

    Amit Kamdar Moderator Staff Member


    The program was written to take BACKUPs at both Loading and Exit events.
     
    Meena Mhatre likes this.





  21. i removed the top line and checked it is not asking i just asked y it is given in the startup because it will lead to performance of data so...
     


  22. Amit Kamdar

    Amit Kamdar Moderator Staff Member


    For companies with 100s of entries per day OR synchronization between multiple locations............... best advisable to take during loading and exit............
     


  23. Amit Kamdar

    Amit Kamdar Moderator Staff Member


    As for me...I use COBIAN Backups............takes backups every 30 minutes or any time limit as you define........... and I take triple tier backup..........
    1.... normal backup
    2....synchro backup
    3... backup with historical archives.
     
    Jaydeep Shah and Meena Mhatre like this.


Share This Page