npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

akeebabackup

v0.1.7

Published

NodeJS npm module for AkeebaBackup JSON APIs

Downloads

12

Readme

AkeebaBackup module for NodeJS

This module lets you easily use the AkeebaBackup JSON APIs in node.js. AkeebaBackup (http://www.akeebabackup.com) is THE backup software for Joomla! As of version 0.1.0, it supports only the raw encryption, but in the future, if needed, the other encryption system supported by the apis will be added.

Installation

Using npm:

npm install akeebabackup

You can also clone this repository into your node_modules directory.

Examples

Trigger a Backup

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	yoursite.backup();
	yoursite.on('completed', function(data){console.log('backup completed')});
} catch(e) {
	console.log(e);
}

Available methods

Here you'll be able to see a list of methods available in the akeebabackup module, such as:

backup

Trigger a new backup

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.backup(['profile_id']); 
	yoursite.backup(); 
	
	yoursite.on('started', function(data){
		console.log('backup started');
	});
	yoursite.on('step', function(data){
		console.log('backup has completed a step');
	});
	yoursite.on('completed', function(data){
		console.log('backup completed');
	});
} catch(e) {
	console.log(e);
}

backup

Stops a running backup

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.backup(['profile_id']); 
	yoursite.backup(); 
	
	yoursite.on('stopped', function(){
		console.log('backup stopped');
	});
	
	yoursite.stopBackup();

} catch(e) {
	console.log(e);
}

srp

Trigger a System Restore Point backup for an extension

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.srp('name', 'type', ['group']); 
	yoursite.srp('akeeba', 'component');
	
	yoursite.on('started', function(data){
		console.log('srp started');
	});
	yoursite.on('step', function(data){
		console.log('srp has completed a step');
	});
	yoursite.on('completed', function(data){
		console.log('srp completed');
	});
} catch(e) {
	console.log(e);
}

delete

Completely removes a backup record from the database. Unlike deleteFiles, it will delete the files corresponding to the given backup record and the backup record itself. The Akeeba Backup component will not be aware that the specified backup record ever existed.

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.delete(id, callback)
	yoursite.delete(42, function(result){

	});
} catch(e) {
	console.log(e);
}

deleteFiles

Remove only the files corresponding to a given backup record, but not the backup record itself. The Akeeba Backup component will display this backup record marked as "obsolete"

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.deleteFiles(id, callback)
	yoursite.deleteFiles(42, function(result){

	});
} catch(e) {
	console.log(e);
}

download

Download (step by step) a backup file to a file

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.download(id, file)
	yoursite.download(42, 'yourbackup.jpa');

	yoursite.on('completed', function(){
		console.log('File saved');
	});
} catch(e) {
	console.log(e);
}

downloadDirect

Download a file directly, without encryption and step by step download

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.downloadDirect(id, file)
	yoursite.downloadDirect(42, 'yourbackup.jpa');

	yoursite.on('completed', function(){
		console.log('File saved');
	});
} catch(e) {
	console.log(e);
}

getBackupInfo

Gets detailed information about a specific backup record.

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.getBackupInfo(id, callback)
	yoursite.getBackupInfo(42, function(data){
		console.log(data);
	});
} catch(e) {
	console.log(e);
}

getLog

Downloads The log file for a specific backup tag

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.getLog(tag, file)
	yoursite.getLog('remote', 'log.txt');

	yoursite.on('completed', function(){
		console.log('Log saved');
	});
} catch(e) {
	console.log(e);
}

getProfiles

Returns a list of the backup profiles. The callback receives an array:

	[{id, name}]
var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.getProfiles(callback)
	yoursite.getProfiles(function(data){
		console.log(data);
	});
} catch(e) {
	console.log(e);
}

getVersion

Returns the version number of the API and the component. The callback receives an object:

	{api, component, date, edition, updateinfo}
var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.getVersion(callback)
	yoursite.getVersion(function(data){
		console.log(data);
	});
} catch(e) {
	console.log(e);
}

listBackups

Returns a (partial) list of the backup records known to the component. The records are presented in reverse order, i.e. the first record is the last backup attempt, whereas the last record is the earliest backup attempt known to the component.

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.listBackups(callback, start, limit)
	yoursite.listBackups(function(data){
		console.log(data);
	}, 0, 50);
} catch(e) {
	console.log(e);
}

update

Triggers the entire akeeba update process

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	yoursite.update();

	yoursite.on('step', function(){
		console.log('step completed');
	});
	yoursite.on('completed', function(){
		console.log('update completed');
	});
} catch(e) {
	console.log(e);
}

updateGetInformation

Returns update status information, as returned by Live Update itself

var akeeba = require('akeebabackup');
var yoursite = new akeeba('http://www.example.com', 'yoursecretkey');

try {
	// yoursite.updateGetInformation(callback, force_fetch_new_data)
	yoursite.updateGetInformation(function(data){
		console.log(data);
	}, true);
} catch(e) {
	console.log(e);
}