How to export/backup a pad in CMD?
Hi,
I'm struggling to try to export a pad from the CMD using curl so I could cron a daily backup on my server.
From etherpad wiki, it seems we should just need to add /export/txt
at the end of the url of a pad.
But how we deal with the identification?
curl --basic --user htaccessUSER:htaccessPASS -X POST -H "Content-Type: application/json" -d '{"login":"mypadsLOGIN","password":"mypadsPASS"}' https://mypads.myserver.fr/mypads/api/auth/login
is giving me:
{"success":true,"user":{"_id":"xxxxx","login":"mypadsLOGIN","email":"xxxx@xxx.fr","firstname":"xx","lastname":"","organization":"","color":"#00ff2a","padNickname":"","eplAuthorToken":"someAuthorToken","groups":["YYY-group"],"bookmarks":{"groups":[],"pads":[]},"userlists":{},"useLoginAndColorInPads":true,"hideHelp":false,"lang":"en","ctime":1619283150731,"active":true,"key":"someKey"},"token":"someToken"}
So then I'm trying sth like this using the token:
curl --basic --user htaccessUSER:htaccessPASS https://mypads.myserver.fr/mypads/index.html?/mypads/group/YYY-group/pad/view/myPad-someID/export/txt?&auth_token=somToken
But I'm not getting the content, just the main html page...
<!DOCTYPE html>
<!-- vim:set sw=2 ts=2 sts=2 ft=html expandtab: -->
<html>
<head>
<title>MyPads</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta property="og:title" content="MyPads — Etherpad with accounts">
<meta property="og:type" content="website">
<meta property="og:url" content="http://mypads.myserver.fr/mypads/index.html">
<meta property="og:image" content="http://mypads.myserver.fr/mypads/index.htmlimg/mypads_fav.ico">
<link href="css/mypads.css" rel="stylesheet">
<link href="img/mypads_fav.ico" rel="shortcut icon">
<link href="css/mypads-hide-help-blocks.css" rel="stylesheet">
</head>
<body>
<div id= "mypads"></div>
<script src="js/mypads.js"></script>
</body>
</html>
What's the procedure to do backups of the pads?
Cheers