Poster | Thread |
fingus
 |  |
Backup Script Posted on 2-Jan-2011 18:38:32
| | [ #1 ] |
|
|
 |
Cult Member  |
Joined: 20-Oct-2006 Posts: 747
From: Havixbeck / Germany | | |
|
| i wrote this small backup-script:
cd Workbench: echo "Systembackup wird erstellt...." lha -aezrx a Backup:Backup/Systembackup/backup_02_jan_2011.lha #? echo "Systembackup fertig!" cd Programme:Internet/Simplemail/.folders echo "E-Mail-Backup wird erstellt...." lha -aezrx a Backup:Backup/E-Mails/mails_02_jan_2011.lha #? echo "E-Mail-Backup fertig!"
But how i can get a timestamp in amigados to fill it in to line 3 and 7? _________________ I´m back in 2023 on Classic Amiga with my A1200/Blizzard1230IB@50Mhz, 32MB RAM, AmigaOS3.2 and ROMs, Indivision AGA MK3, Author of Amiga-Flipclock (OS4) |
|
Status: Offline |
|
|
jPV
|  |
Re: Backup Script Posted on 2-Jan-2011 19:51:34
| | [ #2 ] |
|
|
 |
Cult Member  |
Joined: 11-Apr-2005 Posts: 840
From: .fi | | |
|
| Uhmm.. without any deeper thoughts, amigados date command doesn't seem too suitable for it, but maybe some dirty arexx addition would work... like:
rx "say space(date(),1,'_')" >env:backupdate cd Workbench: echo "Systembackup wird erstellt...." lha -aezrx a Backup:Backup/Systembackup/backup_$backupdate.lha #? echo "Systembackup fertig!" cd Programme:Internet/Simplemail/.folders echo "E-Mail-Backup wird erstellt...." lha -aezrx a Backup:Backup/E-Mails/mails_$backupdate.lha #? echo "E-Mail-Backup fertig!"
_________________ - The wiki based MorphOS Library - Your starting point for MorphOS - Software made by jPV^RNO |
|
Status: Offline |
|
|
swoodall
|  |
Re: Backup Script Posted on 2-Jan-2011 19:53:45
| | [ #3 ] |
|
|
 |
Regular Member  |
Joined: 17-Sep-2003 Posts: 248
From: Raleigh NC, USA | | |
|
| @fingus
The simplest way is probably to write the backup command to a temp file and run it, so
Quote:
cd Workbench: echo "Systembackup wird erstellt...." date lformat="lha -aezrx a Backup:Backup/Systembackup/backup_%d_%h_%Y.lha #?" to T:bdate{$$} execute T:bdate{$$} delete >NIL: T:bdate{$$} quiet echo "Systembackup fertig! (hoffentlich)"
|
If I was going to rely on a script like this for backups, I would recommend some error checking and re-entrancy protection. |
|
Status: Offline |
|
|
Severin
|  |
Re: Backup Script Posted on 2-Jan-2011 20:15:12
| | [ #4 ] |
|
|
 |
Elite Member  |
Joined: 18-Aug-2003 Posts: 2740
From: Gloucestershire UK | | |
|
| @fingus
Or try this:
set today `date lformat="%d_%m_%Y"` cd Workbench: echo "Systembackup wird erstellt...." lha -aezrx a Backup:Backup/Systembackup/backup_{today}.lha #? echo "Systembackup fertig!" cd Programme:Internet/Simplemail/.folders echo "E-Mail-Backup wird erstellt...." lha -aezrx a Backup:Backup/E-Mails/mails_{today}.lha #? echo "E-Mail-Backup fertig!" unset today
Last edited by Severin on 02-Jan-2011 at 08:18 PM.
_________________ OS4 Rocks  X1000 beta tester, Sam440 Flex (733)
Visit the Official OS4 Support Site for more help.
It may be that your sole purpose is to serve as a warning to others. |
|
Status: Offline |
|
|
fingus
 |  |
Re: Backup Script Posted on 5-Jan-2011 20:58:40
| | [ #5 ] |
|
|
 |
Cult Member  |
Joined: 20-Oct-2006 Posts: 747
From: Havixbeck / Germany | | |
|
| Thanks for your help!
#2 is working perfectly!
_________________ I´m back in 2023 on Classic Amiga with my A1200/Blizzard1230IB@50Mhz, 32MB RAM, AmigaOS3.2 and ROMs, Indivision AGA MK3, Author of Amiga-Flipclock (OS4) |
|
Status: Offline |
|
|
Deniil715
 |  |
Re: Backup Script Posted on 6-Jan-2011 10:36:57
| | [ #6 ] |
|
|
 |
Elite Member  |
Joined: 14-May-2003 Posts: 4238
From: Sweden | | |
|
| @fingus
I find backing up to archives dangerous because if there is ever a bit error in the archive it could render the whole backup useless.
I myself use BackUp (www.onyxsoft.se) which makes a mirror copy of one directory to another without copying unchanged files. Such a backup is trivial to restore and easy to pick just any random file from even if the media had suffered damage. It also handles links so for example the SDK: could be backed up. _________________ - Don't get fooled by my avatar, I'm not like that (anymore, mostly... maybe only sometimes)  > Amiga Classic and OS4 developer for OnyxSoft. |
|
Status: Offline |
|
|
fingus
 |  |
Re: Backup Script Posted on 6-Jan-2011 11:18:25
| | [ #7 ] |
|
|
 |
Cult Member  |
Joined: 20-Oct-2006 Posts: 747
From: Havixbeck / Germany | | |
|
| @Deniil715
Ouh, that sounds very good. I will test it, thanks for your TIP!
_________________ I´m back in 2023 on Classic Amiga with my A1200/Blizzard1230IB@50Mhz, 32MB RAM, AmigaOS3.2 and ROMs, Indivision AGA MK3, Author of Amiga-Flipclock (OS4) |
|
Status: Offline |
|
|
fricopal!
|  |
Re: Backup Script Posted on 20-Mar-2025 2:46:25
| | [ #8 ] |
|
|
 |
Cult Member  |
Joined: 12-Mar-2025 Posts: 799
From: Unknown | | |
|
| Quote:
by Deniil715 on 6-Jan-2011 10:36:57
@fingus
I find backing up to archives dangerous because if there is ever a bit error in the archive it could render the whole backup useless.
I myself use BackUp (www.onyxsoft.se) which makes a mirror copy of one directory to another without copying unchanged files. Such a backup is trivial to restore and easy to pick just any random file from even if the media had suffered damage. It also handles links so for example the SDK: could be backed up. |
BackUp creates an exact replica, allowing selective restoration without relying on potentially corrupted archives. |
|
Status: Offline |
|
|