Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
1b9d528e
Commit
1b9d528e
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Pelican blog backups
parent
bfeb35c8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-app-pelican
+76
-4
76 additions, 4 deletions
src/freedombone-app-pelican
with
76 additions
and
4 deletions
src/freedombone-app-pelican
+
76
−
4
View file @
1b9d528e
...
...
@@ -123,19 +123,91 @@ function upgrade_pelican {
}
function
backup_local_pelican
{
echo
-n
''
source_directory
=
/etc/blog
if
[
-d
$source_directory
]
;
then
dest_directory
=
pelican
function_check backup_directory_to_usb
backup_directory_to_usb
$source_directory
$dest_directory
fi
source_directory
=
/var/www/
$PELICAN_BLOG_DOMAIN
/htdocs
if
[
-d
$source_directory
]
;
then
dest_directory
=
pelican-site
function_check backup_directory_to_usb
backup_directory_to_usb
$source_directory
$dest_directory
fi
}
function
restore_local_pelican
{
echo
-n
''
if
[
-d
/etc/blog
]
;
then
if
[
-d
$USB_MOUNT_DLNA
/backup/pelican
]
;
then
temp_restore_dir
=
/root/temppelican
function_check restore_directory_from_usb
restore_directory_from_usb
$temp_restore_dir
pelican
cp
-r
$temp_restore_dir
/etc/blog/
*
/etc/blog/
if
[
!
"
$?
"
=
"0"
]
;
then
rm
-rf
$temp_restore_dir
function_check set_user_permissions
set_user_permissions
function_check backup_unmount_drive
backup_unmount_drive
exit
527942
fi
rm
-rf
$temp_restore_dir
fi
fi
if
[
-d
/var/www/
$PELICAN_BLOG_DOMAIN
/htdocs
]
;
then
if
[
-d
$USB_MOUNT_DLNA
/backup/pelican-site
]
;
then
temp_restore_dir
=
/root/temppelican-site
function_check restore_directory_from_usb
restore_directory_from_usb
$temp_restore_dir
pelican-site
cp
-r
$temp_restore_dir
/var/www/
$PELICAN_BLOG_DOMAIN
/htdocs/
*
/var/www/
$PELICAN_BLOG_DOMAIN
/htdocs/
if
[
!
"
$?
"
=
"0"
]
;
then
rm
-rf
$temp_restore_dir
function_check set_user_permissions
set_user_permissions
function_check backup_unmount_drive
backup_unmount_drive
exit
2946282
fi
rm
-rf
$temp_restore_dir
fi
fi
}
function
backup_remote_pelican
{
echo
-n
''
if
[
-d
/etc/blog
]
;
then
backup_directory_to_friend /etc/blog pelican
fi
if
[
-d
/var/www/
$PELICAN_BLOG_DOMAIN
/htdocs
]
;
then
backup_directory_to_friend /var/www/
$PELICAN_BLOG_DOMAIN
/htdocs pelican-site
fi
}
function
restore_remote_pelican
{
echo
-n
''
if
[
-d
/etc/blog
]
;
then
if
[
-d
$SERVER_DIRECTORY
/backup/pelican
]
;
then
temp_restore_dir
=
/root/temppelican
function_check restore_directory_from_friend
restore_directory_from_friend
$temp_restore_dir
pelican
cp
-r
$temp_restore_dir
/etc/blog/
*
/etc/blog/
if
[
!
"
$?
"
=
"0"
]
;
then
exit
782352
fi
rm
-rf
$temp_restore_dir
fi
fi
if
[
-d
/var/www/
$PELICAN_BLOG_DOMAIN
/htdocs
]
;
then
if
[
-d
$SERVER_DIRECTORY
/backup/pelican-site
]
;
then
temp_restore_dir
=
/root/temppelican-site
function_check restore_directory_from_friend
restore_directory_from_friend
$temp_restore_dir
pelican-site
cp
-r
$temp_restore_dir
/var/www/
$PELICAN_BLOG_DOMAIN
/htdocs/
*
/var/www/
$PELICAN_BLOG_DOMAIN
/htdocs/
if
[
!
"
$?
"
=
"0"
]
;
then
exit
76382562
fi
rm
-rf
$temp_restore_dir
fi
fi
}
function
remove_pelican
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment